IF function help on a simple formula

Highlighted
New Contributor

Hi there, i am looking for help on a very basic formula:

 

Cell C1 = If cell A1 and/or cell B1 is blank, then return blank, otherwise return the result of Cell B minus Cell A.

 

I have tried multiple options but don't get the preferred answer.

7 Replies
Highlighted

@Tian77 

It could be

=IF((LEN(A1)+LEN(B1))*LEN(B1),B1-A1,"")
Hi Sergei, i copied your formula, however am still getting a error: "not trying to type a formula" , excel thinks i am trying to type a statement.
Highlighted

@Tian77 

Please check the formula in attached file

Highlighted

@Tian77 

Try this: 

=IF((A1="")+(B1=""),

"",

B1-A1)

Highlighted
Great, thanks Twifoo, this works ! Much appreciated
Highlighted
Thanks Sergei, the formula posted by Twifoo fits my condition on the file. Thanks for the help !
Highlighted
Your appreciation is my delight!