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.
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

jaya

Board Regular
Joined
Aug 18, 2004
Messages
225
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,488
Messages
5,601,976
Members
414,488
Latest member
rjp847

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
Top