Macro: Month to Date Goal

carolvshimmer

New Member
Joined
Jan 11, 2005
Messages
20
So I have a spreadsheet like this

A-L are the Hourly goals for the months Jan-Dec

M is the Year to Date Hourly Goal, it goes up each month obviously, for example in Febuary, it is the Jan Hourly Goal + Feb Hourly Goal, in March it is Jan Hourly Goal + Feb Hourly Goal + Mar Hourly Goal, etc.

I want a macro that will automatically include the next month into the Year to Date Hourly goal, so I don't have to keep re-writing the sum formula

Any ideas?

Thanks!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Why not use the formula:
=sum(A1:L1)
or are all months listed.

The other way is to use the formula:
=SUMIF($A$1:$L$1,"<="&TODAY(),$A2:$L2)
or
=SUMIF($A$1:$L$1,"<="&M1,$A2:$L2)
where M1 = the last day of the month you want to add to.
 
Upvote 0
What about inserting January Hourly Goal in column A, (cell A2=Jan Hourly Goal), then in B2 the Formula "=A2" and copy down from B2 to L2, Then, when you have to add February Hourly goal, select B2, press "F2" and add the goal (B2 Formula: "=A2+Feb Hourly Goal"), the same for March (C2 Formula: "=B2+Mar Hourly Goal") and so on.

Post for feedback

Ciao
 
Upvote 0

Forum statistics

Threads
1,203,468
Messages
6,055,599
Members
444,800
Latest member
KarenTheManager

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