Sum Range based on multiple criteria

jmabbott77

New Member
Joined
Mar 15, 2018
Messages
6
I cannot seem to figure this one out... tried sumifs, sumproduct, index/match. Here's what I'm trying to do:

Sum data in an array that matches 3 different criteria coming from both columns and rows. Maybe it's best to illustrate. Here's a simplified version:

CompanyAllocation201320132013201420142014201520152015
PDTech22222
PDDomain3333333
PDGW8888
GravTech444444
GravDomain555
GravGW9999
BSMTech6666
BSMDomain777
BSMGW1111

<tbody>
</tbody>


So I have the raw data which is Company, Allocation, and multiple columns of yearly data. I'd like this to summarize into Company, Allocation, and sum of the year. Note that the raw data may have row gaps or be mixed up and such so I can't just use a simple formula and fill down.
I'd like a formula that can lookup and match both company and allocation and year and then sum the year row that matches that company and allocation row. Like this:

CompanyAllocation201320142015
PDTech
PDDomain
PDGW
...

<tbody>
</tbody>


Column 2013 for PD Tech should end up with 6
Column 2014 for PD Tech should end up with 4
etc.

Does that make sense? Any idea on how to do this with a smart formula that can lookup, match, and sum?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Welcome to Mr Excel forum

Try

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
1
Company​
Allocation​
2013​
2013​
2013​
2014​
2014​
2014​
2015​
2015​
2015​
Company​
Allocation​
2013​
2014​
2015​
2
PD​
Tech​
2​
2​
2​
2​
2​
PD​
Tech​
6​
4​
0​
3
PD​
Domain​
3​
3​
3​
3​
3​
3​
3​
PD​
Domain​
9​
9​
3​
4
PD​
GW​
8​
8​
8​
8​
PD​
GW​
24​
8​
0​
5
Grav​
Tech​
4​
4​
4​
4​
4​
4​
6
Grav​
Domain​
5​
5​
5​
7
Grav​
GW​
9​
9​
9​
9​
8
BSM​
Tech​
6​
6​
6​
6​
9
BSM​
Domain​
7​
7​
7​
10
BSM​
GW​
1​
1​
1​
1​
11

Formula in O2 copied across and down
=SUMPRODUCT(($A$2:$A$100=$M2)*($B$2:$B$100=$N2)*($C$1:$K$1=O$1)*$C$2:$K$100)

M.
 
Upvote 0
The formula worked perfectly for me.

Questions about the data in C2:K10:
1. Are there formulas in the range C2:K10 that in some situations return ""?
2. Are there errors #N/A in the range C2:K10?

M.
 
Upvote 0
All the data in C2:K10 are numbers. There are no errors or "" results.
So the formula worked for me in the simplified model I posted, but it didn't work in the real model.
I tried parsing out the formula parts one at a time, and the results are not #N/A except when I add the very last bit: *$C$2:$K$100)
 
Upvote 0
All the data in C2:K10 are numbers. There are no errors or "" results.
So the formula worked for me in the simplified model I posted, but it didn't work in the real model.
I tried parsing out the formula parts one at a time, and the results are not #N/A except when I add the very last bit: *$C$2:$K$100)

Can you post the formula you are using?

M.
 
Upvote 0
This is my exact formula: =SUMPRODUCT(('Amort Schedule'!$A$3:$A$64='Intangibles Summary'!$B7)*('Amort Schedule'!$B$3:$B$64='Intangibles Summary'!$C7)*('Amort Schedule'!$BS$1:$FP$1='Intangibles Summary'!F$6)*'Amort Schedule'!$BS$3:$CD$61)
 
Upvote 0
This is my exact formula: =SUMPRODUCT(('Amort Schedule'!$A$3:$A$64='Intangibles Summary'!$B7)*('Amort Schedule'!$B$3:$B$64='Intangibles Summary'!$C7)*('Amort Schedule'!$BS$1:$FP$1='Intangibles Summary'!F$6)*'Amort Schedule'!$BS$3:$CD$61)

All the ranges must be same size - the last range (red) is not and should not include column B (Allocation)
Try change to
'Amort Schedule'!$CS$3:$CD$64)

M.
 
Upvote 0
I don't understand where are you data?
Why
Amort Schedule'!$BS$1:$FP$1='Intangibles Summary'!F$6)*'Amort Schedule'!$BS$3:$CD$61)

Tell us the exact location of your data

M.
 
Last edited:
Upvote 0
All the ranges must be same size

Ahhhhhh! This was key!! I didn't realize this. It works now!!
Brilliant. Many many thanks.

I aligned the last two ranges of the formula which did not match up before.
My final formula is: =SUMPRODUCT(('Amort Schedule'!$A$3:$A$64='Intangibles Summary'!$B7)*('Amort Schedule'!$B$3:$B$64='Intangibles Summary'!$C7)*('Amort Schedule'!$CE$1:$FP$1='Intangibles Summary'!G$6)*'Amort Schedule'!$CE$3:$FP$64)
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,254
Members
448,556
Latest member
peterhess2002

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