darkhorse
darkhorse

Reputation: 8782

Make a cell empty instead of zero if its formula fails in Google Sheets

Lets say I have 3 cells with the following contents:

A1 = "" (Empty)
B1 = "" (Empty)
C1 = PRODUCT(A1, B1)

I assumed C1 would be empty given that A1 and B1 are empty. However, C1 displays 0 instead. What I want to do is make C1 empty if any/both of A1 and B1 is/are empty. Is there a way to do this? I read somewhere that spreadsheets treat empty cells as 0.

Upvotes: 0

Views: 441

Answers (2)

player0
player0

Reputation: 1

you can do it like:

=IF(LEN(A1&B1), PRODUCT(A1, B1), )

0

Upvotes: 2

BruceWayne
BruceWayne

Reputation: 23285

Just use If():

=IF(OR(A1="",B1=""),"",PRODUCT(A1,B1))

(Or use AND() if both need to be blank to return "".)

Upvotes: 1

Related Questions