Trying to discount zero value in Excel.
My formula is
however if either
X19 contain a value of zero I want the formula to be
=IF(U19*X19=0, SUM(U19+X19), SUM(U19+X19)/2)
or more simple:
=IF(U19*X19=0, U19+X19, (U19+X19)/2)
You could use COUNTIF. You would need to call it twice since it does not accept disjoint cells.
=(U19 + X19) / (COUNTIF(U19,"<>0") + COUNTIF(X19,"<>0"))