Search code examples
excelexcel-formulasumifs

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 ):

  • I need to get the sum os values when Feature1 is either (a or b) and Feature2 is (m or n)
  • The features need to be setted by Range (in the example ColumnE for feature1 and ColumnF for feature2), not manually

The answer should be 2

Image Here


Solution

  • 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