Lesson 51 of 92 · Free Excel Course
Excel
Excel ISBLANK Function: Check for Blank Cells (and Blanks That Aren't Blank)
Use ISBLANK, ="", LEN and COUNTBLANK to check for empty cells, find cells that only look blank, and build IF checks with ISNUMBER, ISTEXT and ISERROR.
A cell that looks empty isn't always empty. That's why =ISBLANK(B4) can say FALSE on a cell you can see is blank, and why COUNTBLANK and ISBLANK can disagree about the same range. This lesson sorts it out: what ISBLANK actually checks, how it differs from =B2="" and LEN, how to count blanks, how to find and fix the cells that only look blank, and how to combine ISBLANK, ISNUMBER, ISTEXT and ISERROR with IF to build checks that flag problems for you. Every example uses the same eight-row order list from the free practice workbook.
ISBLANK: syntax and first example
ISBLANK asks one question: is this cell completely empty? The syntax is:
=ISBLANK(value)
value is the cell to test, usually a single reference like B2. It returns TRUE if the cell holds nothing at all, and FALSE if it holds anything: a number, text, a space, an error or a formula (even one that shows nothing). It's one of Microsoft's IS functions and works the same in Microsoft 365, Excel 2016 to 2024, Excel for Mac and Excel for the web.
Open the Practice sheet. It's a list of eight orders with a customer, an email address and a quantity. Column D works out a line total with =IF(C2="","",C2*5), which shows nothing when the quantity is missing.
- Click E2 and type
=ISBLANK(B2), then press Enter. You get FALSE, because B2 holds an email address. - Drag the fill handle from E2 down to E9.
- Look at the results: only E3 and E8 say TRUE.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Customer | Qty | Line total ($5 each) | ISBLANK(Email) | Email="" | |
| 2 | Ana Ruiz | ana@example.com | 12 | 60 | FALSE | FALSE |
| 3 | Ben Cole | 4 | 20 | TRUE | TRUE | |
| 4 | Cara Diaz | 7 | 35 | FALSE | FALSE | |
| 5 | Dev Patel | dev@example.com | FALSE | FALSE | ||
| 6 | Eli Moss | 3 | 15 | FALSE | FALSE | |
| 7 | Fay Lin | fay@example.com | 15 | 75 | FALSE | FALSE |
| 8 | Gus Hale | 20 | 100 | TRUE | TRUE | |
| 9 | Hana Kim | hana.kim | 9 | 45 | FALSE | FALSE |
Four email cells look empty, yet ISBLANK finds only two. B4 contains a single space and B6 contains a non-breaking space pasted from a web page. You can't see either character, but Excel can.
ISBLANK vs ="" vs LEN: which cells count as blank?
There are three common ways to ask "is this cell blank?", and they give different answers. In F2 type =B2="" and copy it down. The comparison asks "is the value of B2 equal to empty text?" It's TRUE for B3 and B8, just like ISBLANK, and FALSE for the space and the non-breaking space, because a space is not empty text.
The difference between the two shows up on a formula that returns "". D5 has =IF(C5="","",C5*5) and shows nothing because Dev's quantity is missing:
| Test on D5 (a formula showing nothing) | Result | Why |
|---|---|---|
=ISBLANK(D5) | FALSE | The cell holds a formula, so it isn't empty |
=D5="" | TRUE | The formula's result is empty text |
=LEN(D5)=0 | TRUE | The result has zero characters |
So the rule is:
- ISBLANK is TRUE only for a truly empty cell.
=A1=""is TRUE for a truly empty cell and for a formula that returns "". Microsoft's own "check if a cell is blank" examples use both ISBLANK and this "" method.=LEN(A1)=0gives the same answer as=A1="", and LEN also tells you how many characters are hiding. Type=LEN(B4)and=LEN(B6)in any spare cell: both return 1. The LEN function page covers it in detail.
For most IF formulas, A1="" is the better test, because a column of formulas that show nothing should usually count as empty. Use ISBLANK when you really need to know whether someone typed anything at all, or whether a cell has been left free for data entry.
To test the opposite, "is this cell filled in?", wrap ISBLANK in NOT: =NOT(ISBLANK(B2)). Or use the not-equal sign: =B2<>"". The NOT function page shows more ways to flip a test.
Count blanks: COUNTBLANK vs COUNTA
To count instead of test, use COUNTBLANK for empty cells and COUNTA for filled ones. The average, min, max and count lesson introduces both; here's how they treat the tricky cells. Fill in the yellow Summary cells on the Practice sheet:
| A | B | |
|---|---|---|
| 11 | Summary | Result |
| 12 | Truly empty emails (COUNTBLANK) | 2 |
| 13 | Filled email cells (COUNTA) | 6 |
| 14 | Emails that are really missing | 4 |
| 15 | Length of B2 (a real email) | 15 |
| 16 | Length of B4 (looks empty) | 1 |
| 17 | Length of B6 (looks empty) | 1 |
| 18 | Line totals showing nothing (COUNTBLANK) | 1 |
| 19 | Line total cells with something in (COUNTA) | 8 |
=COUNTBLANK(B2:B9)returns 2. Like ISBLANK, it doesn't count the space or the non-breaking space.=COUNTA(B2:B9)returns 6: the four real emails plus the two invisible characters.=COUNTBLANK(D2:D9)returns 1. Here COUNTBLANK and ISBLANK disagree: Microsoft says COUNTBLANK does count cells with formulas that return "", while ISBLANK(D5) is FALSE.=COUNTA(D2:D9)returns 8, because COUNTA counts every cell with a formula in it, including D5.
That overlap catches people out: D5 is counted by both COUNTBLANK and COUNTA, so the two don't add up to the number of rows. To count the cells that are really empty, including hidden spaces, use a helper column (next section) and count its TRUEs with =COUNTIF(G2:G9,TRUE), which returns 4. To count with conditions instead, see COUNTIF and SUMIF.
Blanks that aren't blank: find and fix them
Cells that look empty but aren't come from a few places:
- A space typed by accident, or left behind when someone "deleted" a value by pressing the spacebar.
- A non-breaking space (character 160) from text copied off a web page or out of an email.
- A formula that returns "", like column D.
- A lone apostrophe. Typing
'on its own makes a cell look empty, and Excel no longer treats it as empty. - Other invisible characters such as line breaks from imported data.
Find them. Three ways:
- A LEN column. Next to the data, type
=LEN(B2)and copy down. Any cell that looks empty but shows 1 or more has hidden characters. - Go To Special. Select B2:B9, press F5 or Ctrl+G, click Special, choose Blanks and click OK. You can also get there with Home > Find & Select > Go To Special. Excel selects only B3 and B8, the truly empty cells. Anything that looks blank but isn't selected has something in it.
- Filter. Turn on a filter (see sort and filter) and open the column's drop-down: (Blanks) shows the truly empty cells.
Fix them. A space is easy to clear: select the cell and press Delete. For a whole column, build a "really empty?" test that strips the hidden characters first. In G2 type:
=LEN(TRIM(SUBSTITUTE(B2,CHAR(160)," ")))=0
Read it from the inside out. SUBSTITUTE swaps each non-breaking space (CHAR(160)) for a normal space, TRIM removes the spaces, and LEN counts what's left. If nothing is left, the cell is really empty. Copy it down: B3, B4, B6 and B8 are TRUE. TRIM can't remove character 160 on its own, which is why SUBSTITUTE has to go first; the text functions lesson shows the same trick for cleaning names. For line breaks and other non-printing characters from imported files, wrap the text in CLEAN: Microsoft says it removes the first 32 non-printing characters (codes 0 to 31), but not character 160. See the CLEAN function.
Numbers stored as text are the other look-alike. C4 and C7 show 7 and 15, but they're text. =SUM(C2:C9) returns 48 because SUM skips text; the real total is 70. =SUMPRODUCT(C2:C9*1) gives 70, because multiplying by 1 turns text numbers into real numbers. To fix the cells themselves, click the green triangle Excel puts in the corner (the "Numbers formatted as text or preceded by an apostrophe" check) and choose Convert to Number.
ISNUMBER, ISTEXT, ISERROR and the other IS functions
ISBLANK has siblings, and each one returns TRUE or FALSE. The IS function cheat sheet on the Practice sheet tests seven values with seven functions:
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 27 | IS function cheat sheet | ISNUMBER | ISTEXT | ISLOGICAL | ISBLANK | ISERROR | ISERR | ISNA |
| 28 | 120 | TRUE | FALSE | FALSE | FALSE | FALSE | FALSE | FALSE |
| 29 | 120 (typed as text) | FALSE | TRUE | FALSE | FALSE | FALSE | FALSE | FALSE |
| 30 | TRUE | FALSE | FALSE | TRUE | FALSE | FALSE | FALSE | FALSE |
| 31 | #N/A | FALSE | FALSE | FALSE | FALSE | TRUE | FALSE | TRUE |
| 32 | #DIV/0! | FALSE | FALSE | FALSE | FALSE | TRUE | TRUE | FALSE |
| 33 | (formula returning "") | FALSE | TRUE | FALSE | FALSE | FALSE | FALSE | FALSE |
| 34 | (empty cell) | FALSE | FALSE | FALSE | TRUE | FALSE | FALSE | FALSE |
- ISNUMBER is TRUE for numbers, and dates (which Excel stores as numbers). Microsoft notes IS functions don't convert values, so
=ISNUMBER("19")is FALSE: the quotes make it text. - ISTEXT is TRUE for text, including numbers stored as text and the empty text from a "" formula.
- ISLOGICAL is TRUE only for the values TRUE and FALSE, not for the word "TRUE" in quotes.
- ISERROR is TRUE for any error value: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? or #NULL!.
- ISERR is TRUE for any error except #N/A.
- ISNA is TRUE only for #N/A, the "not found" error from lookups.
There's also ISNONTEXT (TRUE for anything that isn't text, including blanks) and ISREF.
Combine IF with IS functions
On their own, IS functions return TRUE or FALSE. Put them inside IF and they become checks that label each row.
Flag a missing value. =IF(ISBLANK(B2),"Missing","OK") is the classic. On our data it would miss the space and the non-breaking space, so the practice workbook uses the stronger test in I2:
=IF(LEN(TRIM(SUBSTITUTE(B2,CHAR(160)," ")))=0,"Missing email",IF(ISNUMBER(SEARCH("@",B2)),"OK","Check email"))
Check for text inside a cell. The second IF uses ISNUMBER(SEARCH("@",B2)). SEARCH returns the position of "@" if it's there, or #VALUE! if it isn't, and ISNUMBER turns that into TRUE or FALSE. Hana's "hana.kim" has no @, so she gets "Check email".
Check the type of a value. In J2: =IF(ISBLANK(C2),"Missing qty",IF(ISTEXT(C2),"Text - fix it","OK")). Dev gets "Missing qty", and Cara and Fay get "Text - fix it".
| I | J | |
|---|---|---|
| 1 | Email status | Qty check |
| 2 | OK | OK |
| 3 | Missing email | OK |
| 4 | Missing email | Text - fix it |
| 5 | OK | Missing qty |
| 6 | Missing email | OK |
| 7 | OK | Text - fix it |
| 8 | Missing email | OK |
| 9 | Check email | OK |
Count rows that pass. =COUNTIFS(G2:G9,FALSE,H2:H9,TRUE) counts rows that have an email and a numeric quantity: 2 (Ana and Hana). H2:H9 is =ISNUMBER(C2) copied down.
Catch only the errors you expect. =IF(ISNA(XLOOKUP(...)),"Not found",...) shows "Not found" for a missing code but still shows a real problem like #REF!. IFERROR and IFNA are shorter ways to do this; see XLOOKUP and INDEX/MATCH.
You can use the same tests as conditional formatting rules, for example =LEN(TRIM(SUBSTITUTE($B2,CHAR(160)," ")))=0 applied to B2:B9 to shade the really-missing emails red.
On a Mac and in Excel for the web, all of these functions work the same way. On a Mac, open Go To Special by pressing Control+G and clicking Special.
Try it yourself
Download the practice workbook. The Practice sheet has the order list with yellow cells for every formula; the Answers sheet has them all filled in.
- In E2:F9, compare
=ISBLANK(B2)with=B2="". Only B3 and B8 are TRUE in both. - Type
=LEN(B4)and=LEN(B6)in spare cells. Both return 1. - In G2:G9, use the TRIM/SUBSTITUTE test. Four emails are really missing.
- In H2:H9, use
=ISNUMBER(C2). C4, C5 and C7 are FALSE. - Build the two status columns in I and J.
- Fill the Summary: COUNTBLANK 2, COUNTA 6, SUM 48 vs the real total 70, ISBLANK(D5) FALSE.
- Fill the IS function cheat sheet, then use Go To Special > Blanks on B2:B9.
Common mistakes
- Expecting ISBLANK to see a "" formula as blank. It won't. Use
=A2=""or=LEN(A2)=0. - Pressing the spacebar to "clear" a cell. It leaves a space. Press Delete instead.
- Using TRIM alone on web text. TRIM leaves the non-breaking space (character 160). SUBSTITUTE it first.
- Testing a whole range with ISBLANK in one cell.
=ISBLANK(B2:B9)doesn't mean "are they all blank" (in Microsoft 365 it spills one TRUE or FALSE per cell). Use=COUNTA(B2:B9)=0or COUNTBLANK. - Adding COUNTBLANK and COUNTA and expecting the row count. "" formulas are counted by both.
- Typing quotes around numbers in a test.
=ISNUMBER("19")is FALSE because "19" is text. - Trusting SUM on imported numbers. Numbers stored as text are skipped. Check with ISTEXT or the green triangles.
What's next
You can now tell a truly empty cell from one that only looks empty, count blanks correctly, and build IF checks that flag missing or wrong data. The previous lesson, random numbers, showed how to generate test data. Next, trace precedents and formula auditing shows how to follow a formula back to its inputs and track down a wrong number. Or go back to the full Excel course.
Frequently asked questions
Why does ISBLANK return FALSE when the cell looks empty?
Because the cell isn't empty. ISBLANK is TRUE only when a cell holds nothing at all. A formula that returns "", a space, a non-breaking space copied from a web page or a lone apostrophe all make the cell look empty while ISBLANK says FALSE. Check with =LEN(A2): anything above 0 means a hidden character such as a space is in there (a "" formula and a lone apostrophe both give 0). To treat a "" formula result as blank, test =A2="" instead of ISBLANK.
What's the difference between ISBLANK and ="" in Excel?
=A2="" is TRUE for a truly empty cell and for a formula that returns "". ISBLANK(A2) is TRUE only for the truly empty cell. Neither one treats a cell with a space as blank. In most IF formulas, A2="" is the safer choice because it also catches formulas that show nothing.
How do I check if a cell is not blank?
Use =NOT(ISBLANK(A2)), which is TRUE when the cell holds anything, or compare with the not-equal sign: =A2<>"". Inside IF: =IF(A2<>"","Filled","Missing"). See the NOT function for how NOT flips TRUE and FALSE.
Does COUNTBLANK count cells with formulas that return ""?
Yes. Microsoft says COUNTBLANK counts cells with formulas that return "" (empty text), even though ISBLANK says those cells aren't blank. Cells holding 0 are not counted. COUNTA counts those "" cells too, so a "" cell can show up in both totals.
What's the difference between ISERROR, ISERR and ISNA?
ISERROR is TRUE for every error value. ISERR is TRUE for every error except #N/A. ISNA is TRUE only for #N/A. Use ISNA when a lookup that finds nothing (#N/A) is expected but other errors should still show.
How do I check if a cell contains certain text?
Wrap SEARCH in ISNUMBER: =ISNUMBER(SEARCH("@",B2)) is TRUE when B2 contains @ anywhere. SEARCH returns a position number when it finds the text and #VALUE! when it doesn't, so ISNUMBER turns that into TRUE or FALSE. SEARCH ignores upper and lower case; use FIND if case matters.