Google-sheets – Google Sheets Blank Cells with a function

google sheets

How do I change a simple subtraction function =B3-A3 to return a blank cell if either of the 2 cells is blank?

Best Answer

Short answer

=IF(OR(ISBLANK(B3),ISBLANK(A3)),"A3 or B3 are blank",B3-A3)

Explanation

  • Use ISBLANK to test if cell is blank
  • Use OR to check if any of its arguments is true
  • Use IF to return something if the condition returns true and other thing if the condition returns false