Sum numbers between two specific cells

Dan1000

Board Regular
Joined
Nov 4, 2006
Messages
210
I need a formula to sum the values in a series of cells where the cell to the left is a specific number and the cell to the right is a different specific number.

Any help would be much appreciated.
 
It works in the first row (row2) but when I drag down it does not work in any of the following rows
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
It’s going to be searching for 8 and 6 if you drag it down. Are you meaning to search for those same numbers in each row?
 
Upvote 0
The value would be 10 if the question was to sum the numbers between 8 and 6 in this instance. Always 9 cells next to each other. Always the numerals 1 to 9 in each of the cells.

Hi, here is a formula based option you can try.


Excel 2013/2016
ABCDEFGHIJKLM
1Num 1Num 2Result
28712639548610
Sheet1
Cell Formulas
RangeFormula
M2=SUM(INDEX(A2:I2,MATCH(K2,A2:I2,0)):INDEX(A2:I2,MATCH(L2,A2:I2,0)),-K2,-L2)
 
Last edited:
Upvote 0
Edit: Oops, FormR posted basically same thing while I was composing my post. :)

See if this is any use. It doesn't matter whether the 2 specified numbers are in the correct order (left to right) or not. It should sum the cells between anyway.

Excel Workbook
ABCDEFGHIJKLM
1Between 1Between 2Result
28712639548610
36712839548610
4562147938620
55621479385832
Sum Between
 
Last edited:
Upvote 0
Hi, here is a formula based option you can try.

Excel 2013/2016
ABCDEFGHIJKLM
1Num 1Num 2Result
28712639548610

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
M2=SUM(INDEX(A2:I2,MATCH(K2,A2:I2,0)):INDEX(A2:I2,MATCH(L2,A2:I2,0)),-K2,-L2)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Now you're a grand master...don't think, feeeeeeel!...thank you soooooo much

Dan
 
Last edited by a moderator:
Upvote 0
Thanks Peter. Always find your help with Excel top notch! No worries getting there after the grand master
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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