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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,224,823
Messages
6,181,171
Members
453,021
Latest member
Justyna P

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