Excel Not Equal to Blank: Formulas, Examples, and Fixes

Formulas & functions · Updated November 18, 2026

To test whether a cell is not blank in Excel, use the not-equal operator with an empty string: with the value to check in A2, enter =A2<>"". It returns TRUE when A2 contains a value and FALSE when it is empty or displays an empty text result, making it useful for IF formulas, filters, counts, and conditional formatting.

What “not equal to blank” means in Excel

Excel does not have a separate “not blank” comparison operator. The symbols <> mean “not equal to,” and two quotation marks with nothing between them represent an empty text string. Together, <>"" tests whether a cell’s value differs from empty text.

For a direct check, assume A2 contains the word Cedar. The formula =A2<>"" returns TRUE. If A2 is genuinely empty, it returns FALSE. A number such as 0 is a value, not an empty string, so it also counts as not blank for this test. This is a useful general-purpose test when you want to know whether a cell has something meaningful to pass to the next part of a formula.

Be clear about the word “blank,” though: a cell that looks empty is not always an empty cell. It could contain a formula that returns empty text, a space, or another invisible character. The right test depends on whether you mean “nothing is stored here” or “nothing is visibly displayed.”

Truly empty cells versus formulas that display nothing

A cell is truly empty when it contains no value, text, or formula. By contrast, a formula can return an empty text result, often written as "", so the cell looks blank even though it contains a formula. For example, a formula might show a result only after another cell has been filled in. A test using <>"" treats that empty text result as blank for the comparison.

If you need to check whether a cell is physically empty rather than whether its displayed result is empty, use ISBLANK. With A2 genuinely empty, =ISBLANK(A2) returns TRUE. If A2 contains a formula that displays nothing, ISBLANK returns FALSE, because the formula itself is in the cell. This distinction matters in audits, data-entry checks, and workbooks where formulas are prefilled down a column.

For many reports, the displayed-result test is more useful: a formula returning empty text usually should not be treated as a visible entry. For checking whether someone has actually entered anything into a cell, ISBLANK may better match the question. Neither test is universally “more correct”; they answer different questions.

Choose the test that matches the task

Use <>"" when the goal is to identify cells whose result is not empty text. Use ISBLANK when you specifically need to identify cells with nothing stored in them. For a quick comparison:

  • Genuinely empty cell: A2<>"" is FALSE, and ISBLANK is TRUE.
  • Cell containing a formula that returns empty text: A2<>"" is FALSE, and ISBLANK is FALSE.
  • Cell containing a space: A2<>"" is TRUE, and ISBLANK is FALSE.
  • Cell containing zero: A2<>"" is TRUE, and ISBLANK is FALSE.

These results explain why a “not blank” test can differ from a count of occupied cells. COUNTA counts cells containing formulas even when those formulas display empty text. COUNTBLANK, on the other hand, counts genuinely empty cells and cells whose formulas return empty text. Choose a function based on what you want the count to represent, not just on how the worksheet looks.

Use not-blank tests in IF formulas

A common use is to show a label only when a source cell has a value. Assume A2 contains Cedar. Enter =IF(A2<>"","Present","Blank"); the result is Present. If A2 is empty or displays an empty text result, the result is Blank. IF checks the condition first, then returns the second argument when it is TRUE and the third when it is FALSE.

This pattern helps prevent unfinished rows from showing unwanted calculations or messages. For example, you might keep a result column visually clean until a name or order number is supplied. It also works when the checked cell contains a number, date, or other text value; the comparison is about whether the result is empty text, not about a particular kind of data.

When building a longer formula, put the not-blank test inside the condition rather than comparing the final calculation to a blank. That makes the logic easier to read and helps avoid calculating from missing input. If a cell containing zero should be treated as missing in your workflow, add a separate zero check; zero is not blank.

Count cells that are not blank

For a quick count of cells with entries, COUNTA is often convenient, but remember that it counts formulas returning empty text. If you want to count cells whose results are not empty text, SUMPRODUCT can apply the comparison to each cell in a range. Assume A2:A5 contains a genuinely empty cell, the text Oak, a formula result that displays empty text, and the number 0. Enter =SUMPRODUCT(--(A2:A5<>"")); the result is 2, because Oak and 0 pass the test while the other two do not.

COUNTBLANK answers a related but different question. With the same A2:A5 layout, =COUNTBLANK(A2:A5) returns 2: it counts the genuinely empty cell and the formula result that displays empty text. That may be exactly what you want for a completeness check, but it will not tell you how many cells are physically empty with no formula. Use ISBLANK-based logic if that distinction is essential.

For a simple list where formulas are not involved, COUNTA may be the clearest choice. Before using any count in a summary, test it against a small range containing a true blank, a formula-empty cell, a zero, and a space. That reveals which cases the count includes and helps prevent a misleading total.

Spaces and other invisible characters

A cell containing one or more spaces is not empty text. Therefore, A2<>"" returns TRUE when A2 contains a space, even though the cell may look blank. This often happens when data is pasted from another system, or when a user presses the space bar instead of leaving a cell empty. A comparison alone cannot tell whether the visible-looking blank is made up of whitespace.

If A2 may contain ordinary spaces, use TRIM to remove leading and trailing spaces and reduce repeated spaces between words. With A2 containing three ordinary spaces, =LEN(TRIM(A2))=0 returns TRUE. If A2 contains a word, the result is FALSE. This checks whether any characters remain after that cleanup, rather than simply comparing the original cell with empty text.

Some copied data includes a nonbreaking space, a character that looks like an ordinary space but TRIM may not remove. If A2 contains ordinary spaces, nonbreaking spaces, or a mixture of the two and no other text, =LEN(TRIM(SUBSTITUTE(A2,CHAR(160),"")))=0 returns TRUE. SUBSTITUTE removes the character represented by CHAR(160), then TRIM handles ordinary spaces. If the cell contains other invisible characters, such as line breaks, additional cleanup may be needed; inspect the source data rather than assuming every blank-looking cell contains the same character.

Highlight nonblank cells with conditional formatting

You can use the same logic to highlight cells that have a value. Select the range to format, then choose Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. If the selected range starts at A2, enter =A2<>"", choose a format, and confirm the rule. Excel adjusts the relative row reference for the other cells in the selected range.

The reference in the rule should match the top-left cell of the selection. For example, if the range starts at B5, use B5 in the rule rather than A2. If you use an absolute reference such as $A$2, every cell in the selected range will be evaluated against A2 instead of its own corresponding cell. Conditional formatting is useful for highlighting completed entries, but spaces will still count as nonblank unless you build a whitespace-cleaning test into the rule.

Common problems and quick checks

If a formula says a cell is not blank even though it looks empty, check for spaces or invisible characters first. Click the cell and inspect the formula bar; a visible formula there means the cell is not physically empty. A formula that returns empty text can look blank while still making ISBLANK return FALSE. If the value came from a web page or another application, nonbreaking spaces are another possibility.

If a result seems wrong, verify the cell reference and the formula’s quotation marks. The empty string must have two straight double quotes with nothing between them. Curly quotation marks copied from formatted text are not valid formula syntax. Also check whether zero is a legitimate value in your data: the not-blank test treats zero as an entry. If you mean “not blank and not zero,” that is an additional condition, not the same definition of blank.

For a formula returning TRUE or FALSE, check the source cell’s actual contents and test a few known cases side by side. A useful test set includes a truly empty cell, a formula returning empty text, a single space, zero, and ordinary text. This small check is often faster and more reliable than changing a larger formula based only on how cells appear on screen.

Frequently Asked Questions

What is the Excel formula for not blank?
Use =A2<>"" to return TRUE when A2 is not empty text and FALSE when it is empty or returns empty text. Replace A2 with the cell you want to test.

Does Excel treat a formula returning "" as blank?
It is treated as empty text by a comparison such as <>"", but the cell is not genuinely empty because it contains a formula. That is why ISBLANK returns FALSE for it.

Does zero count as blank in Excel?
No. Zero is a value, so a zero in A2 makes A2<>"" TRUE. Add a separate zero condition if your worksheet needs to treat zero as missing.

Why does Excel say a blank cell is not blank?
The cell may contain a space, a nonbreaking space, or another invisible character. It may also contain a value that is difficult to see because of formatting. Inspect the cell contents and clean the relevant characters before relying on a not-blank test.

Should I use ISBLANK or <>""?
Use ISBLANK to test whether a cell has nothing stored in it. Use <>"" to test whether its result is different from empty text, which treats a formula displaying nothing as blank for that comparison.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.