IF Cell Is Blank Formula

Use IF with a test for emptiness to show a message, skip a calculation, or flag incomplete rows. There are two common tests, and they behave differently with cells that look empty but are not.

Free, no sign-up required · 5 free generations a day

Last updated

Describe your task, get the formula

Type what you need in plain English, or pick an example below. You get the formula, a step-by-step explanation, and a worked example.

Blank-check formulas

Syntax
=IF(A2="", "blank", "not blank")
=IF(ISBLANK(A2), "blank", "not blank")
=COUNTBLANK(A2:C2)

A2="" is true for cells that are empty and for cells that hold an empty string, such as the result of another formula. ISBLANK is true only for cells that are genuinely empty.

Examples

Leave the result empty until there is input

=IF(A2="","",A2*B2)

Returns an empty cell while A2 is blank, so the column stays clean instead of filling up with zeros or errors.

Flag rows that have any empty field

=IF(COUNTBLANK(A2:C2)>0,"Incomplete","Complete")

COUNTBLANK counts the empty cells in the row. Anything above zero means at least one field is missing.

Show a dash instead of a zero date

=IF(A2="","-",A2)

A reference to an empty cell returns 0, which shows as a date in 1900. Testing for blank first lets you show a dash instead.

Common mistakes and how to fix them

ISBLANK says FALSE for a cell that looks empty

The cell contains a space, an apostrophe, or a formula that returns an empty string. Use A2="" or LEN(TRIM(A2))=0, which treat all of these as blank.

Checking for 0 instead of blank

A2=0 is also true for an empty cell in Excel, so it cannot tell the two apart. Test A2="" to catch blanks, and A2=0 together with NOT(A2="") for a real zero.

The formula returns an empty string that breaks other formulas

Text such as "" cannot be added. If another formula uses this result in arithmetic, return 0 instead, or wrap that formula in N() or IFERROR.

Frequently asked questions

How do I check that a cell is NOT blank?

Use =IF(A2<>"","has data","empty") or =IF(NOT(ISBLANK(A2)),...). The first one also treats spaces-only formulas as empty.

How do I count the non-blank cells?

Use COUNTA for cells with anything in them, or COUNTIF(range,"<>") if cells with an empty string should be ignored.

Does it work in Google Sheets?

Yes. IF, ISBLANK, and COUNTBLANK use the same syntax in Google Sheets.

Don't want to write it by hand?

Describe what you need in plain English and get a ready-to-use formula in seconds.

Try the formula generator