# Sum Multiple Columns Index Match Matrix

#### aboydprice

##### New Member
How can I write a formula that will sum the value from multiple columns using an index match matrix based approach?

The formula below will work when there is only one column that has the "OC_TECH" value, but I want to sum both values if "OC_TECH" occurs as a column header more than once.

for example the value in cell M4 should be 23, and M4 should be 25

=INDEX(\$C\$4:\$G\$6,MATCH(\$I4,\$B\$4:\$B\$6,0),MATCH(M\$3,\$C\$3:\$G\$3,0))

 B C D E F G H I J K L M 2 OC_840 OC_100 OC_861 OC_TECH OC_TECH OC_840 OC_100 OC_861 OC_TECH 3 Cash 1 4 7 10 13 Cash 1 4 7 10 4 RR 2 5 8 11 14 RR 2 5 8 11 5 TA 3 6 9 12 15 TA 3 6 9 12

<colgroup><col width="64" span="13" style="width:48pt"> </colgroup><tbody>
</tbody>

### Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

#### DRSteele

##### Well-known Member
Welcome to the forum.

You might be better off just multiplying arrays and summing them. So put this formula in J3 and copy across then down.

Code:
``[FONT=Verdana]=SUMPRODUCT((J\$2=\$C\$2:\$G\$2)*(\$I3=\$B\$3:\$B\$5)*\$C\$3:\$G\$5)[/FONT]``

Last edited:

Replies
1
Views
83
Replies
1
Views
186
Replies
4
Views
104
Replies
13
Views
206
Replies
10
Views
160

1,130,218
Messages
5,640,953
Members
417,182
Latest member
mgcorreia

### 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.

### Which adblocker are you using?

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

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