1

My formula in B3 is =A3+B2-B1. I want B3 to be blank if both B2 and B1 are blank also. Could anyone help me with this please?

2 Answers 2

4

Use the IF to create a condition, AND because you need to match multiple conditions, and ISBLANK for your conditions:

=IF(AND(ISBLANK(B1), ISBLANK(B2)), "", A3+B2-B1)
2

To start out, first lets work with one cell. B1.

=IF(B1="","",SUM(A3+B2-B1))

This will return blank if B1 is empty or will do the sum. Now we can just wrap that in another if.

=IF(B2="","",IF(B1="","",SUM(A3+B2-B1)))

The problem with ISBLANK is that if there is a formula in that field, it will not return blank, even if there is no number in the field.

1
  • Good point about the ISBLANK function. However, no need for the SUM, and I think AND is more simple then a nested IF especially when wanting to check for more then 2 conditions. So I would do: =IF(AND(B2="",B1=""),"",A3+B2-B1).
    – User15
    Aug 26, 2015 at 17:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .