Add sum of multiple columns with two matching criteria?

bbarkley

New Member
Joined
Apr 16, 2018
Messages
3
Table 1:

1ABC
2ApplesOranges
3Joe

<tbody>
</tbody>

Table 2:

1ABCD
2ApplesOrangesApples
3Joe543

<tbody>
</tbody>

I would like to be able to pull the sum of an array of columns if the two criteria (name and "apples" as the example) both match.

So sum if Table 1 A3 = "Joe" AND Table 1 B2 = "Apples". But I would like the sum range to be the whole of table 2, so that it would tell me that Joe has 8 apples total. When I put the sum range as B:D or similar, it gives me the #VALUE error.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Let A:C of Sheet1 house table 1; A:D of Sheet2 Table 2.


In B2 of Sheet1, control+shift+enter, not just enter, and copy across:

=SUM(IF(Sheet2!$A$2:$A$10=$A2,IF(Sheet2!$B$1:$D$1=B$1,Sheet2!$B$2:$D$10)))

where Joe is in A2, Apples in B1, and Oranges in C1.

Alternatively, in B2 just enter and copy across:

=SUMIFS(INDEX(Sheet2!$B$2:$D$10,MATCH($A2,Sheet2!$A$2:$A$10,0),0),Sheet2!$B$1:$D$1,B$1)
 
Last edited:
Upvote 0
Another option:

ABCD
1ABC
2ApplesOranges
3Joe84
4Mark73
5Jill42
6
7ApplesOrangesApples
8Joe543
9Jill123
10Mark235

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

</td>
</tbody>
Sheet3


Worksheet Formulas
CellFormula
B3=SUMPRODUCT($B$8:$D$10*($A$8:$A$10=$A3)*($B$7:$D$7=B$2))

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

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,530
Messages
6,125,350
Members
449,220
Latest member
Edwin_SVRZ

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