Spreadsheet Practice

How to check if a cell is blank in Excel

Formula (Excel and Google Sheets)

=IF(C2="","Not shipped",C2-B2)

Test the cell against "": =IF(C2="","Not shipped",C2-B2). ISBLANK(C2) works too, but only for truly empty cells.

Result on the example
one result per row in D2, filled down to D7
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in D2, filled down to D7. Change any input and the result updates, or edit the formula to experiment.

How it works

C2="" is TRUE when the cell is empty, so IF returns the message; otherwise it subtracts the dates, which gives the number of days. Checking first avoids a negative number from subtracting a date from nothing.

=IF(C2="","Not shipped",C2-B2)

Result2

  1. C24/3/2026

    The value in C2.

  2. C2=""FALSE

    The = operator tests whether the two sides are equal.

  3. B24/1/2026

    The value in B2.

  4. C2-B22

    The - operator subtracts.

  5. IF(C2="","Not shipped",C2-B2)2

    IF: Returns one value if a test is true, another if false.

    • logical_testC2=""FALSE
    • value_if_true"Not shipped"not used
    • value_if_falseC2-B22

In Google Sheets

The same formula works in Google Sheets: =IF(C2="","Not shipped",C2-B2). We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=IF(ISBLANK(C2),"Not shipped",C2-B2)2, Not shipped, 5…ISBLANK is TRUE only for a truly empty cell. It's FALSE for a formula that returns "", which ="" treats as blank.
=IF(C2<>"",C2-B2,"Not shipped")2, Not shipped, 5…The same test the other way round: "if it isn't blank, calculate".

Common mistakes

  • A cell with a space looks blank but isn't. Use TRIM(C2)="" when data comes from imports.
  • Days show as a date (like 1/2/1900) if the result cell is date-formatted. Set it to General or Number.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Check if a cell is blank

In D2, show the days between ordering and shipping, or "Not shipped" when the ship date is blank. Fill down to D7.

Questions

How do I check if any cell in a range is blank?

Use COUNTBLANK: =IF(COUNTBLANK(B2:C2)>0,"Incomplete","OK").

How do I return a blank cell instead of text?

Use "": =IF(C2="","",C2-B2).

Checked by running on 2026-10-29: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.