wakefield101

New Member
Joined
Jan 4, 2014
Messages
31
Can anyone please help me figure out a formula to calculate YTD??

What I am trying to achieve:

Sum all months <= current month, ONLY IF months fall within the same year CY (Calendar Year) as the current month

As you can see on the screenshot below, Cell B5 indicates the current month. The timeline below (row 16) only shows a portion of what the actual timeline is. This project goes out to 2019.

Does anyone have any thoughts??

Excel Workbook
ABDEFGHIJKLMNOPQ
3Study Start DateMay-15**************
4Study End DateFeb-19**************
5Current MonthOct-15**************
6****************
14****************
15**% Complete YTD*************
16Service Fee**Apr-15May-15Jun-15Jul-15Aug-15Sep-15Oct-15Nov-15Dec-15Jan-16Feb-16Mar-16Apr-16
18b. Latest Forecast / Accrual**** * * *378,027* * * * * * * * - ** * * *144,010* * * * * * * * - ** * * *324,023* * * *180,013* * * *270,020* * * *270,020* * * *198,014* * * *126,009* * * *324,023* * * * * * * * - *
23****************
Summary
 

Excel Facts

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

thanks for the help, that link did help me find a short term solution:

=IFERROR(SUMPRODUCT(--(YEAR($D$19:$FE$19)=YEAR($B$5)),--($D$19:$FE$19<=DATE(YEAR($B$5),MONTH($B$5),DAY((EOMONTH($B$5,0))))),D21:FE21)/SUMPRODUCT(--(YEAR($D$19:$FE$19)=YEAR($B$5)),--($D$19:$FE$19<=DATE(YEAR($B$5),MONTH($B$5),DAY((EOMONTH($B$5,0))))>=DATE(YEAR($B$5),MONTH($B$5),DAY((EOMONTH($B$5,0))))),D21:FE21),"-")

HOWEVER, I noticed that when I changed the end date (see my initial post: Cell B4), my equation all of a sudden did not work... I receive the #VALUE! error...

Would you happen to know how to fix this issue?
 
Upvote 0
I'm not sure your formula needs to be so complicated. If we could go back to:

Sum all months <= current month, ONLY IF months fall within the same year CY (Calendar Year) as the current month

How does this look?


Excel 2010
ABCDEFGHIJKLMNOP
3Study Start Date15-May
4Study End Date19-Feb
5Current Month15-Oct1,026,073
6
7
8% Complete YTD
9Service Fee15-Apr15-May15-Jun15-Jul15-Aug15-Sep15-Oct15-Nov15-Dec16-Jan16-Feb16-Mar16-Apr
10b. Latest Forecast / Accrual378,027-144,0100324,023180,013270,020270,020198,014126,009324,023
Sheet1
Cell Formulas
RangeFormula
D5=SUMIFS($D$10:$P$10,$D$9:$P$9,"<="&B5,$D$9:$P$9,">="&DATE(YEAR(B5),1,1))
 
Upvote 0

Forum statistics

Threads
1,215,440
Messages
6,124,882
Members
449,193
Latest member
PurplePlop

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