OFFSET and MATCH? How to get rolling 3 month average of income based on moving anchor?

FKalinx

New Member
Joined
Jul 2, 2014
Messages
39
Hello Mr Excel

I am trying to get a rolling average of income for three months. I have created the anchor for current month (which automatically moves based on current month), let's say in cell D1 and want to then average the income in cell B3, C3 and D3 - see below. If the current month was Feb, the anchor would be E1 and the cells I would need averaging would be C3, D3 and E3.

Month - Nov Dec Jan (Current Month)
Cost - 100 200 300
Income 400 400 500

I have tried using OFFSET and MATCH but can't get it to work.

Can a genius please help me out?

Thanks.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi,

Check if this helps:


Book1
ABCDEF
1Monthoktnovdecjanfeb
2Cost175100200300
3Income350400400500
4Average Income0375383433450
Sheet1
Cell Formulas
RangeFormula
B4{=IFERROR(AVERAGE(OFFSET($A$1,2,MATCH(MONTH(B$1),MONTH(1:1)+0,0)-1,1,-3)),0)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
Hi,

Check if this helps:

ABCDEF
Month
Cost
Income
Average Income

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: right"]okt[/TD]
[TD="align: right"]nov[/TD]
[TD="align: right"]dec[/TD]
[TD="align: right"]jan[/TD]
[TD="align: right"]feb[/TD]

[TD="align: center"]2[/TD]

[TD="align: right"]175[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]300[/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]

[TD="align: right"]350[/TD]
[TD="align: right"]400[/TD]
[TD="align: right"]400[/TD]
[TD="align: right"]500[/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]0[/TD]
[TD="align: right"]375[/TD]
[TD="align: right"]383[/TD]
[TD="align: right"]433[/TD]
[TD="align: right"]450[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B4[/TH]
[TD="align: left"]{=IFERROR(AVERAGE(OFFSET($A$1,2,MATCH(MONTH(B$1),MONTH(1:1)+0,0)-1,1,-3)),0)}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]

Thanks, you're a star!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top