sum range values of column depending on criteria

jumbledore

Active Member
Joined
Jan 17, 2014
Messages
262
I have the following table starting from cell A1 to D6:

134538
245769
abcdefghijkl
2355964
351838
mnopqrstuvwx

<tbody>
</tbody>

In cell A9 if I were to enter a value say "stu" it should give me the sum of the 2 rows above. For example if I enter the formula in B9 it should return, 96+8=104. For "ghi", 53+76=129

How do I do so?
Thanks
 
Last edited:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
How's this?


Excel 2010
ABCD
1134538
2245769
3abcdefghijkl
42355964
5351838
6mnopqrstuvwx
7
8CriteriaSum
9stu104
Sheet1
Cell Formulas
RangeFormula
B9=SUMPRODUCT((A3:D3=A9)*(A1:D2)+(A6:D6=A9)*(A4:D5))
 
Upvote 0
very poor way of doing it is

=IFERROR(SUM(OFFSET(INDEX(6:6,1,MATCH(A11,6:6,0)),-2,0),OFFSET(INDEX(6:6,1,MATCH(A11,6:6,0)),-1,0)),SUM(OFFSET(INDEX(3:3,1,MATCH(A11,3:3,0)),-2,0),OFFSET(INDEX(3:3,1,MATCH(A11,3:3,0)),-1,0)))
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

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