Multiple column sum_range for sumifs

JCCarter

New Member
Joined
Dec 30, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I'm trying to sum several columns based on row and column criteria. I cannot figure out what I'm doing wrong. Below is a small portion of my spreadsheet.
My formula is =SUMIFS($AA$5:$AE$8, $Z$5:$Z$8,$Z5,$AA$4:$AE$4,AA$4)
column/rowZAAABACADAE
4TaskSPSSSPA5S3
5Task 1
7.25​
40​
10​
15​
8​
6Task 1
13.25​
80​
12​
25​
15​
7Task 2
0​
0​
0​
0​
0​
8Task 3
0​
0​
0​
0​
0​
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Your ranges need to be of the same size to use SUMIFS.
Since you have Excel 365 try the FILTER function with SUM.

Book1
YZAAABACADAE
4TaskSPSSSPA5S3
5Task 17.254010158
6Task 113.2580122515
7Task 200000
8Task 300000
9
10SumTask 1225.5
Sheet1
Cell Formulas
RangeFormula
AA10AA10=SUM(FILTER($AA$5:$AE$8,$Z$5:$Z$8=$Z$10,""))
 
Upvote 0
From your example it is not entirely clear what you are trying to do, the criteria for row and column don't appear to serve any purpose, to give you something to work with SUMIFS needs all ranges to be the same size, for what you are trying to do you will need to use SUMPRODUCT instead.
Excel Formula:
=SUMPRODUCT($AA$5:$AE$8*($Z$5:$Z$8=$Z5)*($AA$4:$AE$4=AA$4))
Alternatively, as you are only using equal criteria you could use INDEX and MATCH instead
Excel Formula:
=INDEX($AA$5:$AE$8,MATCH($Z5,$Z$5:$Z$8,0),MATCH(AA$4,$AA$4:$AE$4,0))
 
Upvote 0
Your ranges need to be of the same size to use SUMIFS.
Since you have Excel 365 try the FILTER function with SUM.

Book1
YZAAABACADAE
4TaskSPSSSPA5S3
5Task 17.254010158
6Task 113.2580122515
7Task 200000
8Task 300000
9
10SumTask 1225.5
Sheet1
Cell Formulas
RangeFormula
AA10AA10=SUM(FILTER($AA$5:$AE$8,$Z$5:$Z$8=$Z$10,""))
I'm trying to sum all the hours for each task and each labor category (SP, SS, etc.). Since there are more than one row with the same task and more than one column with the same labor category, I cannot use a pivot table without rearranging the data, which is not possible. This is what I'm trying to accomplish

HOURS
Labor CatTask 1Task 2Task 3
A5
40.00​
0.00​
0.00​
S3
23.00​
0.00​
0.00​
SP
42.50​
0.00​
0.00​
SS
120.00​
0.00​
0.00​
Autofill
0.00​
0.00​
0.00​
Grand Total
225.50​
0.00​
0.00​
 
Upvote 0
Something like this maybe?
gtd562 CountIF (version 1).xlsb
ABCDEFG
1TaskSPSSSPA5S3
2Task 17.254010158
3Task 113.2580122515
4Task 200000
5Task 300000
6
7Task 1Task 2Task 3 
8SP42.500 
9SS12000 
10A54000 
11S32300 
12     
13total225.500
Sheet5
Cell Formulas
RangeFormula
B7:E7B7=IFERROR(INDEX($A:$A,AGGREGATE(15,6,ROW($A$2:$A$5)/ISNA(MATCH($A$2:$A$5,$A$7:A$7,0)),1)),"")
A8:A12A8=IFERROR(INDEX($1:$1,AGGREGATE(15,6,COLUMN($B$1:$F$1)/ISNA(MATCH($B$1:$F$1,$A$7:$A7,0)),1)),"")
B8:E12B8=IF(OR(B$7="",$A8=""),"",SUMPRODUCT($B$2:$F$5,($B$1:$F$1=$A8)*($A$2:$A$5=B$7)))
B13:D13B13=SUM(B8:B11)
 
Upvote 0
Solution
Something like this maybe?
gtd562 CountIF (version 1).xlsb
ABCDEFG
1TaskSPSSSPA5S3
2Task 17.254010158
3Task 113.2580122515
4Task 200000
5Task 300000
6
7Task 1Task 2Task 3 
8SP42.500 
9SS12000 
10A54000 
11S32300 
12     
13total225.500
Sheet5
Cell Formulas
RangeFormula
B7:E7B7=IFERROR(INDEX($A:$A,AGGREGATE(15,6,ROW($A$2:$A$5)/ISNA(MATCH($A$2:$A$5,$A$7:A$7,0)),1)),"")
A8:A12A8=IFERROR(INDEX($1:$1,AGGREGATE(15,6,COLUMN($B$1:$F$1)/ISNA(MATCH($B$1:$F$1,$A$7:$A7,0)),1)),"")
B8:E12B8=IF(OR(B$7="",$A8=""),"",SUMPRODUCT($B$2:$F$5,($B$1:$F$1=$A8)*($A$2:$A$5=B$7)))
B13:D13B13=SUM(B8:B11)
Took me a while to get the formulas adjusted to the right data, but thank you sooo much!
 
Upvote 0

Forum statistics

Threads
1,214,865
Messages
6,121,988
Members
449,060
Latest member
mtsheetz

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