Here's my formula for the cell K37:
=IFERROR(1/(1/ArrayFormula(sumifs($H37:$H,$E37:$E,"ABC",MONTH($G37:$G),1))))
the cell K37 returns nothing (it's blank) when there's no cells in $E37:$E range with the "ABC" criteria and some value in corresponding $H37:$H range's cell. And it's fine!
But how do I force the formula to return 0 instead of just a blank cell if there's at least one cell in $E37:$E range, satisfying the "ABC" criteria with the actual $0.00 value in corresponding $H37:$H range's cell?
E G H K
37 ABC Jan-1 $0.00 blank (but I want it to be 0)
38
39
CodePudding user response:
A way:
K37
=ARRAYFORMULA(IF(COUNTIFS($E37:$E,"ABC",MONTH($G37:$G),1),IFERROR(1/(1/SUMIFS($H37:$H,$E37:$E,"ABC",MONTH($G37:$G),1)),0),""))
Check if value exists, if #DIV/0! return 0, otherwise return blank.
