How can I ignore blank cell when using the OFFSET function when working out a 3 month Average

BOB12345

New Member
Joined
Aug 7, 2018
Messages
7
Hi

So I would like to work out a 3 month rolling average of data using an OFFSET function.

The only issue is how can I amend my formula so that if I miss a month's data the cell is ignored an the previous month's data is used?

The formula that I am using is =AVERAGE(OFFSET(B3,0,COUNTA(C3:N3),1,-3)).

Many Thanks

BOB
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Another way

{=SUM(IF(COLUMN(C3:N3)>=LARGE(IF(C3:N3>0,COLUMN(C3:N3)),3),C3:N3))/3}

Array formulas
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself
 
Upvote 0
Moving average of 3 numbers...

Horizontal work out:

In B5 control+shift+enter, not just enter, and copy across:

=AVERAGE(IF(COLUMN(B$3:$N$3) <= SMALL(IF(ISNUMBER(1/B$3:$N$3),COLUMN(B$3:$N$3)),MIN(3,SUM(IF(ISNUMBER(1/B$3:$N$3),1)))),IF(ISNUMBER(1/B$3:$N$3),B$3:$N$3)))

Vertical work out:

In B5 control+shift+enter, not just enter, and copy down:

=AVERAGE(IF(COLUMN(INDEX($B$3:$N$3,ROWS($1:1)):$N$3) <= SMALL(IF(ISNUMBER(1/INDEX($B$3:$N$3,ROWS($1:1)):$N$3),COLUMN(INDEX($B$3:$N$3,ROWS($1:1)):$N$3)),MIN(3,SUM(IF(ISNUMBER(1/INDEX($B$3:$N$3,ROWS($1:1)):$N$3),1)))),IF(ISNUMBER(1/INDEX($B$3:$N$3,ROWS($1:1)):$N$3),INDEX($B$3:$N$3,ROWS($1:1)):$N$3)))
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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