View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mark Lincoln
 
Posts: n/a
Default Can I use more complex logical expression for sumif as creteri

That complicates matters some. We have to sum the rows in which either
criterion is met and subtract the rows where both are met (otherwise
the latter cases would be counted twice). Either of these work:

=SUMPRODUCT(--(A3:A10="MA"),F3:F10)+SUMPRODUCT(--(B3:B105000),F3:F10)-SUMPRODUCT(--(A3:A10="MA"),--(B3:B105000),F3:F10)

=SUMIF(A3:A10,"MA",F3:F10)+SUMIF(B3:B10,"5000",F3 :F10)-SUMPRODUCT(--(A3:A10="MA"),--(B3:B105000),F3:F10)