Summing to and from depending upon input values

mccamli

New Member
Joined
Sep 30, 2004
Messages
11
I've tried to search for an answer to this but don't quite know how to phrase it...

I have a number of columns (1-31...looks suspiciously like a month) and want to sum a range of those columns depending upon two input cells.

So, to sum the 10th to the 18th columns I would like to be able to input the numbers 10 and 18 to drive the result.

I would prefer not to use VBA.

Any ideas? I'm sure it's easy???

Thanks
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
It may not be difficult, but please clarify whether you want all of the rows of the identified columns included in a single sum for the specified columns, or a separate sum for each row?

Cindy
 
Last edited:
Upvote 0
Making a few minor assumptions (for instance that your data starts in column A, and ends in AE, that your first row is a header, and you have entered the starting column in AG2 and the ending column in AH2), the following formula copied down to all of your data rows should work. You'll need to adjust the formula if my assumptions don't match your data.
Code:
=SUM(INDEX(A2:AE2,AG2):INDEX(A2:AE2,AH2))
Hope this helps,
Cindy
 
Upvote 0
Awesome. I use INDEX in INDEX MATCH but have been using it for so long that I forgot exactly what it did!

Thanks Cindy

Ian
 
Upvote 0
Thanks mikerickson,

I'm summing one row at a time...have modified your offset formula to read

=SUM(OFFSET(A5, 0, ($AF$1-1), 1, $AF$2-($AF$1-1)))

Not exactly sure what it does but it also works a treat!

Cheers

Ian
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,958
Latest member
Hat4Life

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