Year to Date v Same Last Year

alancyoung

New Member
Joined
Feb 29, 2008
Messages
29
I hope someone can help me.
See table below.
JanFebMarAprMayJunJulAugSepOctNovDecYTD
201110010001002002000100100200100100700
20122002001000100200 800


<colgroup><col width="64" span="14" style="width:48pt"> </colgroup><tbody>
</tbody>
I am looking for a formula which will SUM Row 2011 in the YTD Column to give a value of 700 as shown. This is because, up until June 2011 the total was 700, which allows me to compare to the 800 value in 2012.

When I input July, I want the value in YTD 2011 to update too, which in this case would remain as 700 due to the 0 value in 2011.

Hope this makes sense and you are able to help.

Thanks

Alan
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Here is one way that should work.
Excel Workbook
ABCDEFGHIJKLMN
1JanFebMarAprMayJunJulAugSepOctNovDecYTD
2201110010001002002000100100200100100700
320122002001000100200800
Sheet
 
Upvote 0
Thanks, but I have an added issue with this solution.
H3:M3 contains formula which at present, returns a zero value, but I don't want N2 to SUM B2:H2. I want it to SUM B2:G2.

However, if the actual figure in H3 is 0, then I want N2 to SUM B2:H2. No idea how to solve, but desperately need help.

Thanks
 
Upvote 0
I hope someone can help me.
See table below.
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
YTD
2011
100
100
100
200
200
100
100
200
100
100
700
2012
200
200
100
100
200
800


<TBODY>
</TBODY>
I am looking for a formula which will SUM Row 2011 in the YTD Column to give a value of 700 as shown. This is because, up until June 2011 the total was 700, which allows me to compare to the 800 value in 2012.

When I input July, I want the value in YTD 2011 to update too, which in this case would remain as 700 due to the 0 value in 2011.

Hope this makes sense and you are able to help.

Thanks

Alan
Here are a couple of ways:

=SUM(B2:INDEX(B2:M2,MATCH("Jul",B1:M1,0)))

Or, if you want the YTD based on the month of today's date:

=SUM(B2:INDEX(B2:M2,MONTH(NOW())))

This one will automatically update when the month changes.
 
Upvote 0
Thanks, but I'm afraid both can't be used.

Using the 1st formula only relates to July, so once I go beyond July it stops calculating, and I can't use the 2nd formula, as I may want to reference the document in another month without updating. I don't think there is an easy answer to this one!
 
Upvote 0
Thanks, but I'm afraid both can't be used.

Using the 1st formula only relates to July, so once I go beyond July it stops calculating, and I can't use the 2nd formula, as I may want to reference the document in another month without updating. I don't think there is an easy answer to this one!
There is, we just need to understand what you want to do.

Ok, then use this version:

=SUM(B2:INDEX(B2:M2,MATCH(O1,B1:M1,0)))

Where O1 = Jul (or whatever month you want).

Just make sure you enter the month name as they appear in B1:M1.
 
Upvote 0
Could you explain the formula above so I can follow it a bit better? From what I understand, I would need to re-enter the formula depending on what month I was referencing? Correct?

If I opened my spreadsheet in November 2012 for instance, would the figure in my worksheet relate to Jul?
 
Upvote 0
Could you explain the formula above so I can follow it a bit better? From what I understand, I would need to re-enter the formula depending on what month I was referencing? Correct?
No.

You enter the ending month in cell O1 (or whatever cell you want to use).

So, if you enter Jul in cell O1 then the sum range will be from Jan to Jul. It sounded like you wanted some flexibility in being able to select the ending month. So, using an input cell to enter the ending month is the way to go (if that's what you wanted to do).

If I opened my spreadsheet in November 2012 for instance, would the figure in my worksheet relate to Jul?
Using this formula:

=SUM(B2:INDEX(B2:M2,MATCH(O1,B1:M1,0)))

It will sum fron Jan to whatever month is entered in cell O1.

The other formula I suggested:

=SUM(B2:INDEX(B2:M2,MONTH(NOW())))

Will automatically update based on the month of today's date.

Since today is July 17, the formula would sum from Jan to Jul. On August 1st, the formula will sum from Jan to Aug. On September 1st, the formula will sum from Jan to Sep.
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

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