View Single Post
  #4   Report Post  
GijsKijlstra GijsKijlstra is offline
Junior Member
 
Location: Singapore
Posts: 20
Send a message via Skype™ to GijsKijlstra
Default SUMIFS with multiple criteria provides wrong result

Thank you Claus. Your follow-up response as well, is greatly appreciated. I had to modify your (1st) solution to avoid a #n/a result:
=SUMPRODUCT((Input!$A$6:$A$100000=I$2)*
(Input!$A$6:$A$100000<= EDATE(I$2,1))*
(Input!$G$6:$H$100000=$G$2)*
(Input!$B$6:$B$100000=$G9)*
Input!$F$6:$F$100000)

Regrettably, after the modification, the result isn’t correct. In the event you have time, let me clarify my requirement:

The only difference between column Input!B and the columns Input!G+H is that Input!B’s range is one column and Input!G+H are separated into two columns. The qualifying role of Input!B and Input!G+H are identical (I can’t merge Input!G and Input!H into one column).

Column Input!G has its own elements and will NOT appear in column Input!H that has its own elements as well and do NOT appear in Input!G.
($G$2) determines the criteria that could be found in the elements in Input!G OR in Input!H. In other words: the determining cell ($G$2) will only be found in Input!B OR Input!G+H.

If I were to do the calculation manually, I would do it as follows:
When the date (Input!$A6:$A100000) matches the month (I$2) AND
The range1 Input!$G6:$G100000) matches criteria1 ($G$2) OR
The range2 Input!$H6:$H100000) matches criteria1 ($G$2) AND
The range3 (Input!$B6:$B100000) matches criteria2 ($G9),
Sum the values (Input!$F6:$F100000)

Is this feasible?