Search code examples
google-sheets

Google Sheets: How to display 0 when reference cell is 0 and blank when reference cell is empty?


I am attempting to set up a Google Sheet cell that returns a 0 if the sum of the reference cells are 0 OR shows as blank when the reference cells are empty. I seem to be able to do one or the other.

Formula:

=IF(IFERROR(SUM(D3,E3))=0,0,(IFERROR(SUM(D3,E3)))) 

returns 0 when reference cells sum = 0 (correct) but when reference cells are empty still shows 0 (incorrect, I want it blank in this case).

I'm sure there's an easy way to do this but can't seem to wrap my head around it. Thanks!


Solution

  • A more succinct approach:

    =arrayformula(if(and(isblank({D3,E3})),,sum(D3,E3)))