To run an IF test when a cell is not blank, use =IF(NOT(ISBLANK(A2)),"Present","Blank"). This example assumes the cell to check is A2; it returns “Present” if A2 contains anything and “Blank” if A2 is truly empty.
How the IF NOT ISBLANK Formula Works
The formula combines three functions. ISBLANK(A2) checks whether A2 is empty and returns TRUE or FALSE. NOT reverses that result, so the test is TRUE when A2 is not blank. IF then returns one result for TRUE and another for FALSE.
The general structure is IF(logical_test, value_if_true, value_if_false). In this example, the logical test is NOT(ISBLANK(A2)), the value for a nonblank cell is the text “Present,” and the value for an empty cell is “Blank.” You can replace either result with a number, a cell reference, or another calculation. Text results need double quotation marks; numbers and cell references do not.
Excel evaluates the test for the cell reference you supply. To check a different cell, replace A2 with its address. If the formula is copied down a column, Excel normally adjusts the relative reference automatically, so a formula checking A2 becomes one checking A3 in the next row.
What ISBLANK Considers Empty
ISBLANK is deliberately strict: it returns TRUE only when the referenced cell has no contents. A cell containing a number, text, a date, a space, or a formula is not blank. A formula that displays nothing still counts as a formula in the cell, so ISBLANK returns FALSE for it.
This distinction matters in imported data and worksheets with formulas. A cell can look empty while still containing something. For example, a formula might return an empty text string, written as two double quotation marks, or a user might have typed a space. Neither makes the cell genuinely empty for ISBLANK. Formatting alone, such as a fill color or number format, does not put a value in an empty cell.
ISBLANK checks the cell itself, not whether the cell looks empty on screen. If a column contains formulas designed to show results only when another cell has an entry, choose a test that matches what you want to count as empty rather than relying on appearance.
Use the Formula with Your Own Results
With order status in A2, for example, you might want a message only after a status has been entered. With the status in A2, this formula returns “Ready” for any nonblank entry and otherwise returns an empty text string:
=IF(NOT(ISBLANK(A2)),"Ready","")
The second result, "", makes the formula cell appear blank when A2 is empty. It does not make the formula cell itself blank. If another formula checks that result cell with ISBLANK, it will find a formula there and return FALSE. That is a common source of confusion in worksheets built from several layers of formulas.
You can also return a value from another cell. With an input in A2 and the corresponding description in B2, this formula displays the description only when A2 is not blank:
=IF(NOT(ISBLANK(A2)),B2,"")
The formula returns the value currently in B2, not a copy of its formatting. If B2 is empty, the result appears empty even though A2 has an entry. Consider whether the return cell can also be blank when designing the test.
ISBLANK Compared with A2<>""
A shorter alternative is to compare the cell with an empty text string. With the value to test in A2, =IF(A2<>"","Present","Blank") commonly gives the desired result. In ordinary use, it treats a genuinely empty cell and a formula that returns an empty string as empty. ISBLANK, by contrast, treats the formula cell as nonblank.
Choose the test according to the meaning of “blank” in your task:
- Use NOT(ISBLANK(A2)) when you mean that the cell physically contains an entry or formula.
- Use A2<>"" when you want a cell displaying an empty result to behave like an empty cell.
- Use a whitespace-cleaning test when a cell containing only spaces should count as empty.
The comparison is not a universal substitute for checking every kind of content. For example, a zero is a value, so a cell containing 0 is not blank. If zero should count as missing for a particular task, test for zero explicitly as well as for blankness. Do not hide or exclude legitimate zeros just because they look visually similar to empty cells in a report.
Ignore Cells That Contain Only Spaces
Neither ISBLANK nor the comparison with an empty string treats a typed space as empty. This can happen when data is pasted from another system or when someone presses the spacebar instead of leaving a cell untouched. For text entries where ordinary spaces should be ignored, TRIM can remove extra ordinary spaces before LEN checks the text length.
With text to check in A2, the following returns “Has text” if a non-space character remains after TRIM, and “Empty or spaces” if the cell is empty or contains only ordinary spaces:
=IF(LEN(TRIM(A2))>0,"Has text","Empty or spaces")
This is most appropriate for text fields. TRIM is not a general-purpose cleaner for every invisible character: it removes regular space characters, but pasted nonbreaking spaces and some other control characters may remain. If the formula classifies an apparently empty cell as having text, inspect the source data or clean it before testing. Also, do not use this approach if spaces themselves are meaningful data.
Combine a Nonblank Test with Another Condition
A nonblank test can be combined with other requirements. For example, a report might need to flag only cells that contain a positive number. With the number in A2, this formula returns “Positive” when A2 is nonblank and greater than zero; otherwise it returns “Check”:
=IF(AND(NOT(ISBLANK(A2)),A2>0),"Positive","Check")
AND requires every condition inside it to be TRUE. In this example the blank test prevents an empty cell from qualifying, and the comparison checks the numeric threshold. If text may appear in A2, the greater-than comparison may not reflect the intended business rule. Validate that the input is numeric or use a separate numeric check when the data can be mixed.
For a checklist, you might instead want to display a warning when a required field is missing. With the required entry in A2, this formula reports “Missing” only when the cell is truly empty:
=IF(ISBLANK(A2),"Missing","OK")
Notice that the test is not wrapped in NOT here: the missing case is the TRUE case for ISBLANK. Writing the condition in the same direction as the outcome can make longer formulas easier to read and check.
Common Problems and How to Fix Them
- The result says nonblank, but the cell looks empty. The cell may contain a formula returning an empty string, a space, or an invisible character. Click the cell and inspect the formula bar, or test the value using an appropriate text-cleaning approach.
- A zero is marked as present. That is expected: zero is a value, not a blank. Add a separate zero condition only if zero should be treated as missing in this particular worksheet.
- The formula shows as text instead of calculating. Check that the cell is not formatted as Text, that the formula begins with an equals sign, and that Show Formulas is not enabled. After correcting the format, re-enter the formula.
- The formula changes references when copied. Relative references adjust as formulas are filled down or across. If every row must test the same cell, make the reference absolute by adding dollar signs, such as $A$2.
- The output is blank but another test says it is not blank. The output cell may contain a formula returning an empty string. A visually blank result is not the same as a truly empty cell.
When entering a formula in Excel for Microsoft 365 on Windows, type it into the formula bar or directly into the selected cell and press Enter. The same functions work in Excel for Mac and Excel for the web. Ribbon locations and some keyboard shortcuts differ between platforms, but no special menu command is needed to use this formula.
Choosing the Right Test for a Worksheet
Before filling a formula through a large range, decide what “not blank” means for the data. For a data-entry form, a formula or a space may not count as a valid response. For a calculation that should run whenever a cell contains anything at all, including a formula, ISBLANK may be the exact test. For a report that hides empty-string results, comparing with an empty string is often a better fit.
Try the chosen test against representative cases before copying it widely: a truly empty cell, text, a number, zero, a formula returning an empty string, and a cell containing a space. This small check can prevent a column of misleading labels or calculations. If the worksheet is shared, a short note explaining whether zeros, spaces, and formula-generated blanks count as missing can help other users enter consistent data.
Frequently Asked Questions
Does ISBLANK return TRUE for a formula that displays nothing?
No. The cell contains a formula, so ISBLANK returns FALSE even if the formula displays an empty string. Use a comparison with an empty string if that displayed-empty result should be treated as blank.
Does Excel consider 0 a blank cell?
No. Zero is a numeric value, so it is not blank. If your rule treats zero as missing, include an explicit test for zero rather than changing the meaning of ISBLANK.
How do I test whether a cell is blank?
With the cell to check in A2, use =ISBLANK(A2). It returns TRUE for a truly empty cell and FALSE if the cell contains a value, text, or formula.
Can I use IF and ISBLANK to leave the result empty?
Yes. With the input in A2, =IF(ISBLANK(A2),"","Complete") displays nothing when A2 is empty and “Complete” otherwise. The formula cell still contains a formula when it displays nothing.
Why does a cell with a space fail the blank test?
A space is text, so the cell is not empty. Remove the space or use a text-cleaning test such as TRIM when ordinary spaces should be ignored.
Related
- Split Text to Columns in Excel: A Practical Guide
- Split Text to Columns in Excel Online: Steps and Fixes
- Split Cell Colour in Excel: Methods and Limitations
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- How to Add a Formula in Excel for Addition: Simple StepsTo add numbers in Excel, select the cell where you want the answer, type a formula that starts…
- Sort List in Excel Formula: SORT, SORTBY, and MoreTo sort a list with a formula in Microsoft Excel for Microsoft 365, use SORT: with values in…
- Excel VLOOKUP Shortcut Keys: What Actually WorksExcel has no dedicated keyboard shortcut that inserts or runs VLOOKUP by itself. The quickest keyboard approach is…
- Excel Formula for Week Start Date: Monday or SundayTo return the Monday of the week containing a date in A2, use =A2-WEEKDAY(A2,2)+1. To return Sunday instead,…
- COUNTIF Distinct Values in Excel: Count Unique ItemsTo count distinct nonblank values in Excel for Microsoft 365, use =IFERROR(ROWS(UNIQUE(FILTER(A2:A100,A2:A100<>""))),0), assuming the values are in A2:A100.…
- Excel Formula List in Hindi: Meanings, Uses and ExamplesAn Excel formula list in Hindi is a guide to common spreadsheet functions, their Hindi meanings, and examples…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.