Getting a sum by matching multiple criteria?

joelnichols

Active Member
Joined
Apr 13, 2004
Messages
406
Office Version
  1. 2003 or older
Platform
  1. Windows
Looking for a formula to match a name in col A to a type in col D and a code in col F , then sum that match from col G. This is similar to the formula I would need , but missing a final variable check from col F.
SUMIF('RH Report'!D:D,A4,'RH Report'!G:G).

Thanks.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Unsure if you have Sumifs is available in your version of Excel, but if it is, perhaps something like this would work. This formula assumes your data starts on the second row.

VBA Code:
=SUMIFS(G2:G7,A2:A7,A2,D2:D7,D2,F2:F7,F2)
 
Upvote 0
#NAME? error. Sumifs must be later version. I'm sure there's another option.
 
Upvote 0
I'm sure there's another option.
Try SUMPRODUCT (but don't use whole column references - just make the ranges big enough to cover any amount of data that you might have)

joelnichols_1.xlsm
DEFG
1NameCodeAmount
2Name 1A1
3Name 2B2
4Name 3A3
5Name 1B4
6Name 2A5
7Name 3B6
8Name 1A7
9Name 2B8
10Name 3A9
RH Report


joelnichols_1.xlsm
ABC
3NameCodeTotal
4Name 2B10
5Name 3A12
Sheet1
Cell Formulas
RangeFormula
C4:C5C4=SUMPRODUCT(--('RH Report'!D$2:D$1000=A4),--('RH Report'!F$2:F$1000=B4),'RH Report'!G$2:G$1000)
 
Upvote 0
Solution
Works great. What does the -- in formula do?

Thanks again for the help.
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,215,331
Messages
6,124,312
Members
449,152
Latest member
PressEscape

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