# How to check if a cell is blank in Excel

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

**Excel:** `=IF(C2="","Not shipped",C2-B2)` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Order | Ordered | Shipped | Days to ship |
| B-301 | 2026-04-01 | 2026-04-03 |  |
| B-302 | 2026-04-02 |  |  |
| B-303 | 2026-04-02 | 2026-04-07 |  |
| B-304 | 2026-04-04 | 2026-04-05 |  |
| B-305 | 2026-04-06 |  |  |
| B-306 | 2026-04-07 | 2026-04-09 |  |

Formula in D2, filled to D7: `=IF(C2="","Not shipped",C2-B2)`

Result: 2; Not shipped; 5; 1; Not shipped; 2

## 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.

## Other ways

- `=IF(ISBLANK(C2),"Not shipped",C2-B2)`: 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")`: 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.

## 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)`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-29.

Source: https://spreadsheetpractice.com/formulas/if-cell-is-blank
