Keep in mind any time you are sharing a formula that we can't see what you are seeing. So while things may make perfect sense to you (who can see everything), it's a bit spotty for those of us "out here." For this reason, it is usually best to share a link to a sample spreadsheet with a small set of realistic data.
That said, I'll give it a go, sight unseen. Try this:
=ArrayFormula(IFERROR(1/(1/MMULT(if(AD99:BY2907="",0,AD99:BY2907), SEQUENCE(COLUMNS(AD:BY),1,1,0)))))
Where MMULT
returns a non-zero number 1/(1/#) will equal the original number. But where MMULT
returns 0, the division of 1/0 will cause an error, which IFERROR
will return as null here.
I also tightened up the elements of the MMULT
parameters, particularly the IF
clause, which was unnecessarily complicated.
ADDENDUM (based on poster comment of 7/14)
If the result of the formula for each cell in the range will only ever be some number, null, or an error, the same structure holds true:
=ArrayFormula(IFERROR(1/(1/your-base-formula)))