Need help with YTD formula - 2 Part Question for simple Spread Sheet

DataValidator

New Member
Joined
May 8, 2014
Messages
5
Hi Everyone,

It would be awesome, if someone can help me with a two part excel question:

I have a simple spreadsheet showing budget/actual numbers in columns for January through December per individual line items in column A (Data Tab). Each month, actual /budget numbers will be entered for that month. I want to create a formula to calculate YTD totals by figuring out which month it is (D7 in Summary Tab) and summing the correct totals for each month per line item. In other words, if May actuals have been entered, I want the year-to-date formula to contain Jan+Feb+Mar+Apr+May totals. I am trying to create this formula in the "Summary" tab in cell F10 which references cell D7 per line item.

Part 2:

I am having trouble trying to create a formula to display the actual Year to date text string in cell F7 in the Summary tab. For example, in the summary tab, if cell D7 displays Apr, I want cell F7 to display the words Jan - Apr.

Any help would be greatly appreciated!! Thank You. I attached an example file for reference!
JanFebMar
1000 Commission$26500
2000 Revenue$1000$3544
3000Salary$32400
4000Expense$2555

<tbody>
</tbody>
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Depending on your fiscal year / calendar, you may have to adjust. A simple way is to set up 1 input cell to enter the date/month.

Above the months the the table posted above, set up a few 'helper cells' that return 1 or 0 depending if your input is greater than or equal to the month list below.

=if(month below <= input month, 1 , 0 )

then you can use the sumifs() function to sum your YTD. Depending on how your headers and input cells are formatted, you might use some date functions to help the formula:
=if(month(A1)<= month(b1), 1, 0)
or
=if(month(datevalue(a1&" 1, 2014"))<=month(datevalue(b1&" 1, 2014")),1,0)


Part 2:
F7: ="Jan-"&a1
Depending on how it's formatted.
F7: ="Jan-"&text(a1,"mmm")
 
Upvote 0

Forum statistics

Threads
1,215,262
Messages
6,123,935
Members
449,134
Latest member
NickWBA

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