How to return the SUM of several multi-criteria INDEX/MATCH results?

dozer11

New Member
Joined
Dec 11, 2015
Messages
6
Simplifying as much as possible, my data is structured as below. What I'm trying to return is the sum from one of the component cost columns of table 2, of entries that are "X" category and "TRUE" boolean from table 1. In the example below, the sum for "X" category, TRUE should return $4.00.

Obviously, looking at this simplified example, the solution that immediately jumps to mind is to just join the tables. However, my actual structure for Table 1 has about 30 "Boolean" fields, and the structure for Table 2 has upwards of 100 "Component Cost" fields. I'll be using horizontal lookups (with INDEX/MATCH) to select the desired "Boolean" column and desired "Component Cost" column.

I feel like I'm missing some very obvious solution here, but I've had my head in the weeds with this particular model for about a week and I think I just need some fresh eyes on it.


Table 1

Component Description (text)Category (text)Boolean
AXTRUE
BXtext
CXTRUE
DYtext
EYTRUE
FZtext
GZTRUE

<tbody>
</tbody>
Table 2
Component Description (text)Component Cost @ Lot Size = 1Component Cost @ Lot Size = 2Etc...
A$1.00$1.00
B$2.00$2.00
C$3.00$3.00
D$4.00$4.00
E$5.00$5.00
F$6.00$6.00
G$7.00$7.00

<tbody>
</tbody>
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Is this the sort of thing you are after?

<b>SUM</b><br /><br /><table border="1" cellspacing="0" cellpadding="0" style="font-family:Arial,Arial; font-size:8pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:193px;" /><col style="width:213px;" /><col style="width:213px;" /><col style="width:27px;" /><col style="width:28px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >B</td><td >C</td><td >D</td><td >E</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="font-size:10pt; ">Table 1</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="font-size:10pt; ">Component Description (text)</td><td style="font-size:10pt; ">Category (text)</td><td style="font-size:10pt; text-align:left; ">Boolean</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; text-align:right; ">4</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="font-size:10pt; ">A</td><td style="font-size:10pt; ">X</td><td style="font-size:10pt; text-align:left; ">TRUE</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td style="font-size:10pt; ">B</td><td style="font-size:10pt; ">X</td><td style="font-size:10pt; text-align:left; ">text</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td style="font-size:10pt; ">C</td><td style="font-size:10pt; ">X</td><td style="font-size:10pt; text-align:left; ">TRUE</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td style="font-size:10pt; ">D</td><td style="font-size:10pt; ">Y</td><td style="font-size:10pt; text-align:left; ">text</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >7</td><td style="font-size:10pt; ">E</td><td style="font-size:10pt; ">Y</td><td style="font-size:10pt; text-align:left; ">TRUE</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >8</td><td style="font-size:10pt; ">F</td><td style="font-size:10pt; ">Z</td><td style="font-size:10pt; text-align:left; ">text</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >9</td><td style="font-size:10pt; ">G</td><td style="font-size:10pt; ">Z</td><td style="font-size:10pt; text-align:left; ">TRUE</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >10</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >11</td><td style="font-size:10pt; ">Table 2</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >12</td><td style="font-size:10pt; ">Component Description (text)</td><td style="font-size:10pt; text-align:right; ">Component Cost @ Lot Size = 1</td><td style="font-size:10pt; text-align:right; ">Component Cost @ Lot Size = 2</td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >13</td><td style="font-size:10pt; ">A</td><td style="font-size:10pt; text-align:right; ">$1.00 </td><td style="font-size:10pt; text-align:right; ">$1.00 </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >14</td><td style="font-size:10pt; ">B</td><td style="font-size:10pt; text-align:right; ">$2.00 </td><td style="font-size:10pt; text-align:right; ">$2.00 </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >15</td><td style="font-size:10pt; ">C</td><td style="font-size:10pt; text-align:right; ">$3.00 </td><td style="font-size:10pt; text-align:right; ">$3.00 </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >16</td><td style="font-size:10pt; ">D</td><td style="font-size:10pt; text-align:right; ">$4.00 </td><td style="font-size:10pt; text-align:right; ">$4.00 </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >17</td><td style="font-size:10pt; ">E</td><td style="font-size:10pt; text-align:right; ">$5.00 </td><td style="font-size:10pt; text-align:right; ">$5.00 </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >18</td><td style="font-size:10pt; ">F</td><td style="font-size:10pt; text-align:right; ">$6.00 </td><td style="font-size:10pt; text-align:right; ">$6.00 </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >19</td><td style="font-size:10pt; ">G</td><td style="font-size:10pt; text-align:right; ">$7.00 </td><td style="font-size:10pt; text-align:right; ">$7.00 </td><td style="font-size:10pt; "> </td><td style="font-size:10pt; "> </td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b>Spreadsheet Formulas</b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >E2</td><td >=SUMPRODUCT(--<span style=' color:008000; '>(COUNTIFS<span style=' color:#0000ff; '>(A3:A9,A13:A19,B3:B9,"X",C3:C9,TRUE)</span>>0)</span>,B13:B19)</td></tr></table></td></tr></table>
 
Upvote 0
Precisely! I was pretty sure a SUMPRODUCT() would be involved, but I haven't yet mastered those. Thanks so much for the help!
 
Upvote 0
Precisely! I was pretty sure a SUMPRODUCT() would be involved, but I haven't yet mastered those. Thanks so much for the help!
You're welcome. Glad that was what you wanted. Thanks for letting us know. :)
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,192
Members
449,072
Latest member
DW Draft

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