Miguel
Miguel

Reputation: 187

Sumifs with muitiple criteria based on a cell

I am facing a problem with excel. I know we can make a SUMIF using multiple values as criteria, but how can we do this when using SUMIFS ?

What I mean is ( as you can see at the exampled picture ):

The answer should be 2

Image Here

Upvotes: 0

Views: 90

Answers (3)

Ron Rosenfeld
Ron Rosenfeld

Reputation: 60224

Try (using your {a,b,m,n} filter as an example):

=SUM(ISNUMBER(MATCH(A2:A5,E2:E5,0))*ISNUMBER(MATCH(B2:B5,F2:F5,0)))

Or, in case the amount in the val column might not always be one (1):

=SUM((ISNUMBER(MATCH(A2:A5,E2:E5,0))*ISNUMBER(MATCH(B2:B5,F2:F5,0)))*C2:C5)

enter image description here

Upvotes: 1

urdearboy
urdearboy

Reputation: 14580

You can try to SUM an array search for a or b as a constant requirement

=SUM(SUMIFS(C:C,A:A,{"a","b"},B:B,F2))

Upvotes: 3

SJR
SJR

Reputation: 23081

Don't know about SUMIFS but you can use an OR condition with SUMPRODUCT

=SUMPRODUCT(((A2:A5="a")+(A2:A5="b"))*(B2:B5="n"))

Upvotes: 1

Related Questions