Sum MTD and YTD formulas

sachavez

Active Member
Joined
May 22, 2009
Messages
469
Excel 2010

Looking for some help on two formulas:

Sum MTD units
Sum YTD units

Column A contains dates
Column B contains units

Date data starts in cell A3
Unit data starts in cell B3

MTD formula will be in cell A1
YTD formula will be in cell B1

Data set grows daily, but it's at "table" so I ***think*** the formula would be dynamic?

Thanks in advance!

Steve
 
I was able to get the YTD formula

=sumif(A3:A1000,"<="&TODAY(),B3:B1000)

Works well, just need MTD formula
 
Upvote 0
Something like this?


Excel 2010
AB
1
2DateNumber
39/3/20153
49/7/20153
59/11/20154
69/15/20152
79/19/201511
89/23/20155
99/27/20155
1010/1/20158
1110/5/201511
1210/9/20153
1310/13/20151
1410/17/20157
1510/21/20155
1610/25/20156
1710/29/20157
1811/2/20158
1911/6/201511
2011/10/20157
2111/14/201510
22
23MTD36
24YTD117
Sheet8
Cell Formulas
RangeFormula
B23=SUMPRODUCT(--(MONTH($A$3:$A$21)=MONTH(TODAY())),$B$3:$B$21)
B24=SUMPRODUCT(--(YEAR($A$3:$A$21)=YEAR(TODAY())),$B$3:$B$21)
 
Upvote 0
You need to have a current date somewhere. I put it in E1, but you could include it in the formula
A1=SUMIFS(Table1[units],Table1[date],"<="&$D$1,Table1[date],">"&EOMONTH($E$1,-1))
B1==SUMIFS(Table1[units],Table1[date],"<="&$D$1,Table1[date],">"&EOMONTH($E$1,-MONTH($E$1)))
 
Upvote 0
Pretty slick! Thank you.

Now, how do I get same info for years 2013 & 2014?

Something like this?


Excel 2010
AB
1
2DateNumber
39/3/20153
49/7/20153
59/11/20154
69/15/20152
79/19/201511
89/23/20155
99/27/20155
1010/1/20158
1110/5/201511
1210/9/20153
1310/13/20151
1410/17/20157
1510/21/20155
1610/25/20156
1710/29/20157
1811/2/20158
1911/6/201511
2011/10/20157
2111/14/201510
22
23MTD36
24YTD117
Sheet8
Cell Formulas
RangeFormula
B23=SUMPRODUCT(--(MONTH($A$3:$A$21)=MONTH(TODAY())),$B$3:$B$21)
B24=SUMPRODUCT(--(YEAR($A$3:$A$21)=YEAR(TODAY())),$B$3:$B$21)
 
Upvote 0
Checking this option, too. Appreciate the help.

Steve

You need to have a current date somewhere. I put it in E1, but you could include it in the formula
A1=SUMIFS(Table1[units],Table1[date],"<="&$D$1,Table1[date],">"&EOMONTH($E$1,-1))
B1==SUMIFS(Table1[units],Table1[date],"<="&$D$1,Table1[date],">"&EOMONTH($E$1,-MONTH($E$1)))
 
Upvote 0

Excel 2010
ABCD
1
2DateNumber
39/3/20133
410/3/20133
511/2/20134
612/2/20132
71/1/201411
81/31/20145
93/2/20145
104/1/20148
115/1/201411
125/31/20143
136/30/20141
147/30/20147
158/29/20145
169/28/20146
1710/28/20147
1811/27/20148
1912/27/201411
201/26/20157
2111/25/201510
22
23201520142013
24MTD1084
25YTD177710
Sheet8
Cell Formulas
RangeFormula
B24=SUMPRODUCT(--(YEAR($A$3:$A$21)=B$23),--(MONTH($A$3:$A$21)=MONTH(TODAY())),$B$3:$B$21)
B25=SUMPRODUCT(--(YEAR($A$3:$A$21)=B$23),--(MONTH($A$3:$A$21)<=MONTH(TODAY())),$B$3:$B$21)
 
Last edited:
Upvote 0
So close!

New formulas resulting in full year and full month numbers.

Example:

In year 2014, YTD (1/1/14 - 11/12/14) actual is 3,325, while the formula is producing 217,058 units (this is the actual "full year" number).
In year 2014, MTD (11/1/14 - 11/12/14) actual is 67, while the formula is producing 19,508 units (this is the actual for the "full month" number)



Excel 2010
ABCD
1
2DateNumber
39/3/20133
410/3/20133
511/2/20134
612/2/20132
71/1/201411
81/31/20145
93/2/20145
104/1/20148
115/1/201411
125/31/20143
136/30/20141
147/30/20147
158/29/20145
169/28/20146
1710/28/20147
1811/27/20148
1912/27/201411
201/26/20157
2111/25/201510
22
23201520142013
24MTD1084
25YTD177710
Sheet8
Cell Formulas
RangeFormula
B24=SUMPRODUCT(--(YEAR($A$3:$A$21)=B$23),--(MONTH($A$3:$A$21)=MONTH(TODAY())),$B$3:$B$21)
B25=SUMPRODUCT(--(YEAR($A$3:$A$21)=B$23),--(MONTH($A$3:$A$21)<=MONTH(TODAY())),$B$3:$B$21)
 
Upvote 0

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