Home > Mobile >  Google Sheets: ArrayFormula sumifs (with IFERROR). How to add an extra criteria?
Google Sheets: ArrayFormula sumifs (with IFERROR). How to add an extra criteria?

Time:11-11

I have the following perfectly working formula: =IFERROR(1/(1/ArrayFormula(sumifs(G34:G,$E34:$E,"$",MONTH($B34:$B),1))))
It serves the needs explained in [my previously asked question][1]
All I want is to add an extra criteria to that formula so instead of checking just $E34:$E for the "$" value, it would check $E34:$E and, say, $F34:$F for the "$" value and SUMIF only if the "$" is found in both $E34:$E and $F34:$F ranges. And DO NOT SUM if the "$" value is only found in one of the ranges or no range at all.
I've already tried:
=IFERROR(1/(1/ArrayFormula(sumifs(G34:G,$E34:$E&$F34:$F,"$",MONTH($B34:$B),1))))

=IFERROR(1/(1/ArrayFormula(sumifs(G34:G,(IF(MMULT(($E34:$E,"$")*($F34:$F,"$")))))),MONTH($B34:$B),1))
No luck :-(

[1]: https://stackoverflow.com/questions/71207513/google-sheets-arrayformula-sumifs-but-return-some-symbol-or-empty-cell-if-ther

CodePudding user response:

I think you should add it as a third condition and not trying to combine those two columns in one. They'll be summed only if the three conditions are met. Try this:

=IFERROR(1/(1/ArrayFormula(sumifs(G34:G,$E34:$E,"$",$F34:$F,"$",MONTH($B34:$B),1))))

  • Related