Offset Formula - Rolling total

Li_zzza

New Member
Joined
Oct 3, 2017
Messages
13
Hi All,

I am working with a database that needs the rolling total of the last 3 months. For example, let say we are in June. One column will Sum the total of Mar, April, May. Another column for Feb, March, April. And the last one being Jan, Feb, March.

I have figured out how to calculate the rolling total if there is a full set of data (Jan to Dec). Using =SUM(OFFSET($A3,0,COUNT($B3:$M3)-2,1,-3)) ; =SUM(OFFSET($A3,0,COUNT($B3:$M3)-1,1,-3)) ; =SUM(OFFSET($A3,0,COUNT($B3:$M3),1,-3))

How do I calculate the totals if we are in March and the data has not come in for the rest of the months? Ideally I want it to look like something below.

Months [TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Jan[/TD]
[TD]Feb[/TD]
[TD]March[/TD]
[TD]Total of last 3 months[/TD]
[TD]Total of last 3 months minus last month[/TD]
[TD]total of last 3 months minus last 2 months[/TD]
[/TR]
[TR]
[TD]Hours[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]6[/TD]
[TD]5[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD][/TD]
[TD]5[/TD]
[TD]5[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,225,738
Messages
6,186,725
Members
453,368
Latest member
positivemind

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