Year to Date sum of Monthly data for multiple years

bfoxworthy

New Member
Joined
Jun 28, 2011
Messages
7
I feel like this should be pretty straightforward using a Sum and Offset function. I have monthly revenue data in a table as follows:

Excel 2010
BCDEFGHIJKLMNOPQ
11/31/20122/29/20123/31/20124/30/20125/31/20126/30/20127/31/20128/31/20129/30/201210/31/201211/30/201212/31/20121/31/20132/28/20133/31/2013
2Revenue 173,995 171,098 180,910 193,189 282,645 297,107 345,414 364,242 372,352 396,951 379,082 460,580 470,766 441,368 506,636
3
4Year to Date Revenue 173,995 345,093 526,003 719,192 1,001,837 1,298,944 1,644,358 2,008,600 2,380,953 2,777,904 3,156,986 3,617,565 470,766 912,134 1,418,770
5^YTD Sum starts over

<tbody>
</tbody>
Sheet3
I would like to be able to use a single formula to sum the year to date data based on the month. For example: February would include the sum of 2 months (January and February). My date inputs are dynamic from another sheet so I cannot simply use a Sum($C2:C2) style reference. When you get out to January 2013 the formula should only sum the single month.

I tried using a formula like this: =SUM(OFFSET(C2,0,0,,(MONTH(E$C1)))) but this doesn't work.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
With your data in A1:Q4 try this:

=SUMPRODUCT((MONTH($C$1:$Q$1)<=MONTH(I6))*(YEAR(I6)=YEAR($C$1:$Q$1))*(C4:Q4))

where I6 contains the month want to sum up to.

Regards,
 
Upvote 0

Excel 2010
ABCDEFGHIJKLM
1Sales Year To Date
2MonthFeb-12300
3Jan-12Feb-12Mar-12Apr-12May-12Jun-12Jul-12Aug-12Sep-12Oct-12Nov-12Dec-12
4Sales100200300400500600700800900100011001200
Sheet1
Cell Formulas
RangeFormula
C2=SUM(B4:INDEX(B4:M4,MATCH(B2,B3:M3,0)))
 
Upvote 0
With your data in A1:Q4 try this:

=SUMPRODUCT((MONTH($C$1:$Q$1)<=MONTH(I6))*(YEAR(I6)=YEAR($C$1:$Q$1))*(C4:Q4))

where I6 contains the month want to sum up to.

Regards,

This seems to work, would there be any way to replace the sumproduct with an average? That way it is calculating a YTD average?
 
Upvote 0
This seems to work, would there be any way to replace the sumproduct with an average? That way it is calculating a YTD average?

I figured out how to do the average: =(SUMPRODUCT((MONTH($C$1:$Q$1)<=MONTH(I6))*(YEAR(I6)=YEAR($C$1:$Q$1))*(C4:Q4)))/(MONTH(I6)

Thanks for all your help.
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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