summing data when number of columns is variable

michaelpaul

New Member
Joined
Mar 2, 2005
Messages
1
Although this seems easy, i can't figure out how to do it short of writing a macro.

All i want to do is enter data into a table. For my case, i have 52 week projections so I have a value for each week. I then just want to enter the number of weeks to add in a seperate cell and then simply have a column that adds all of my data for the specified number of weeks. that way, if I want to look at 5 week projections instead of 3 week projections, everything is automatically updated.

I know I could write a macro, pass the array to the macro and simly use a count and running sum command but I'd like to do it all on in the native spreadsheet rather than work in the macro environment.

any help would be appreciated

thanks.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Enter the following formula in the top row (row 1 in this instance) and copy it down.

=SUM(A1:INDEX($A$1:$J$18,ROW(),L$22))

A1:J18 is the data range. L22 is the cell where you enter the no. of weeks to add.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,525
Members
449,088
Latest member
RandomExceller01

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