I have Cells A, B and C. Cell C = B - A. The problem is if cell B does not have a value, Cell C has a value of (A). I would like cell C to not have a value if cell B does not have a value.
Another alternative to this would be to use ISBLANK()
inside the IF
statement in cell C?
.
IF(ISBLANK(B1), "", B1-A1)
This checks to see if B1
is blank. If true, it returns nothing. Otherwise it will run the calculation.
You can do this by using an if statement
Here is the formula for if B is empty, A may or may not be empty.
=IF(B1="","",B1-A1)
Here is the formula for if A or B is empty.
=IF(OR(B1="",A1=""),"",B1-A1)
The formula would replace the contents of cell C
I would prefer counting the number of non-empty cells.
=IF(COUNTA(A1:B1)=2,B1-A1,"")