Google-sheets – way to get the `IF()` statement to output nothing if it returns false

formulasgoogle sheets

I've got the following formula

=if(sum(b1:b5)>1, "Yes")

If that equates to true the formula will input "Yes" into the cell.

If that equates to false the formula will input "FALSE" into the cell, this is Google sheet's default action.

To prevent the word "FALSE" being used, I could update the formula to the following :

=if(sum(b1:b5)>1, "Yes", "")

If that equates to true the formula will input "Yes" into the cell.

If that equates to false the formula will input "" into the cell, the problem is that "" is still a string, this will make other formulas like ISBLANK() or COUNTA behave seemingly incorrectly. I know there are ways around this with these other formulas, but it feels more semantic to get to the root of the problem in the IF() formula, rather than try and fix it downstream with another formula.

Is there a way to get the IF() statement to output nothing if it returns false ?

Best Answer

It seems there is no literal for a blank/empty/null cell in Google Sheets. Using that as the third IF argument would be an elegant solution. Something else that works: designate a cell, say, A56, to be kept blank. The following formula would satisfy ISBLANK() (if the sum is 1 or lower):

=if(sum(b1:b5)>1, "Yes", $A$56)

enter image description here

The dollar signs aren't necessary of course, but they can be useful when reusing the formula.