Update formula based on single cell value

aboud60

New Member
Joined
Sep 26, 2011
Messages
3
Is there a way to create a sum formula that changes its range based on the value in a separate, static cell? For example, I want to be able to change the month in a static cell and have that month update a sum formula to create a new YTD value. If it is set to August (or 8), update a sum formula to sum 8 months in a row. Using Excel 2007 under Windows XP.

This is my first posting. Thanks.
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Welcome to the board!

Sure, you could use e.g. =SUM(B2:INDEX(B2:M2,A4)) where A4 stores your 8 value that you'd change.
 
Upvote 0
Is there a way to create a sum formula that changes its range based on the value in a separate, static cell? For example, I want to be able to change the month in a static cell and have that month update a sum formula to create a new YTD value. If it is set to August (or 8), update a sum formula to sum 8 months in a row. Using Excel 2007 under Windows XP.

This is my first posting. Thanks.
Maybe something like this...

Book1
ABCDEFGHIJKLM
18JanFebMarAprMayJunJulAugSepOctNovDec
2_3110491705866362322793
Sheet1

A1 = the month number

=SUM(B2:INDEX(B2:M2,A1))

Note that if A1 is an empty cell the formula will calculate the entire range.
 
Upvote 0
Thanks guys :):) I tried it and it works great! Now my next problem is to sum the remaining months into a different cell. Is there any easy way to accomplish that?

Thanks again!
 
Upvote 0
Thanks guys :):) I tried it and it works great! Now my next problem is to sum the remaining months into a different cell. Is there any easy way to accomplish that?

Thanks again!
Let's assume you have that formula in cell A10.

=SUM(B2:M2)-A10
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,704
Members
452,938
Latest member
babeneker

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