# SUM IF with multiple column and row criteria

#### KATMUC

##### New Member

 Jan Jan Feb Mar Mar Mar Tax 2 2 2 7 Rent 1 1 1 7 Marketing 3 3 2 7 OPEX 5 5 1 7

<tbody>
</tbody>

 Jan Feb Mar Tax Rent Marketing OPEX

<tbody>
</tbody>

Hi, I was trying to summarise the various columns (I tagged several calendar weeks to Jan in a separate sheet), however
[FONT=Calibri, sans-serif]the formula =SUMIF(\$B\$1:\$F\$5;J\$2;INDEX(\$B\$2:\$F\$5;0;MATCH(\$I3;\$A\$2:\$A\$5;0))) worked only for the first row (tax), and not for the remaining rows)[/FONT]

### Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
try this

Excel 2012
ABCDEFG
1JanJanFebMarMarMar
2Tax2227
3Rent1117
4Marketing3327
5OPEX5517
6
7
8JanFebMar
9Tax427
10Rent217
11Marketing627
12OPEX1017
Sheet4
Cell Formulas
RangeFormula
B9=SUMIFS(INDEX(\$B\$1:\$G\$5,MATCH(\$A9,\$A\$1:\$A\$5,0),0),INDEX(\$B\$1:\$G\$5,1,0),B\$8)

 A​ B​ C​ D​ E​ F​ G​ 1​ Jan Jan Feb Mar Mar Mar 2​ Tax 2​ 2​ 2​ 7​ 3​ Rent 1​ 1​ 1​ 7​ 4​ Marketing 3​ 3​ 2​ 7​ 5​ OPEX 5​ 5​ 1​ 7​ 6​ 7​ 8​ Jan Feb Mar 9​ Tax 4​ 2​ 7​ 10​ Rent 2​ 1​ 7​ 11​ Marketing 6​ 2​ 7​ 12​ OPEX 10​ 1​ 7​

<tbody>
</tbody>

b9=SUMPRODUCT((\$A\$2:\$A\$5=\$A9)*(\$B\$1:\$G\$1=B\$8)*(\$B\$2:\$G\$5)) copy across and down

Replies
5
Views
340
Replies
10
Views
680
Replies
7
Views
532
Replies
3
Views
232
Replies
3
Views
118

1,217,257
Messages
6,135,503
Members
449,945
Latest member
noone12344444444

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