Excel IF Not Empty: Formula Guide with Examples
In this article
To test whether a cell is not empty in Excel, use =IF(A1<>"","Not empty","Empty"). The <>"" part means "not equal to blank," so the formula returns your chosen value whenever the cell holds anything at all — text, a number, a date, a zero, or even a space. That is the whole answer; the rest of this guide covers where it goes wrong, how blanks really behave, and the variants you will need for real spreadsheets.
What You'll Need
- Excel for Microsoft 365, Excel 2021, 2019, 2016, or Excel for the web. The formulas below work in all of them.
- A worksheet with at least one column of data you want to test.
- Basic familiarity with typing a formula and pressing Enter.
Nothing needs to be installed or enabled. Menu labels and ribbon wording can differ slightly by version, platform and region, but the formula syntax is identical everywhere.
Step-by-Step
- Pick a helper column. Click the first empty cell to the right of your data, for example B2 if your values start in A2. Keeping results in a separate column means you never overwrite the source data.
- Type the basic test. Enter
=IF(A2<>"","Yes","No")and press Enter. Excel checks A2; if it contains anything, you get Yes, otherwise No. - Swap in your own result values. Replace "Yes" and "No" with whatever you need — a status label like "Complete", a number, a reference to another cell, or a nested formula. Text results must sit inside double quotes; numbers and cell references must not.
- Copy the formula down. Select the cell, grab the small square at its bottom-right corner (the fill handle), and drag down, or double-click the fill handle to fill to the end of the adjacent data. Relative references adjust automatically, so B3 tests A3 and so on.
- Test the edge cases. Type a zero into a source cell and confirm the formula still says Yes. Delete the cell's contents with the Delete key and confirm it flips to No. This proves you are testing for blankness, not for truthiness.
- Use the shorter alternative if you prefer.
=IF(LEN(A2)>0,"Yes","No")does the same job by counting characters. It reads more clearly to some users and behaves identically for normal data. - Apply it to a whole range at once. In Excel for Microsoft 365, enter the formula once in the top cell and it spills down if you point it at a range, for example
=IF(A2:A100<>"","Yes","No"). In older versions, fill down manually instead. - Combine it with other logic. Wrap it in AND or OR when you need more than one condition, such as
=IF(AND(A2<>"",B2<>""),"Ready","Missing data"). This is the pattern behind most "flag incomplete rows" tasks. - Turn it into a count. To count non-empty cells directly, use
=COUNTA(A2:A100). To count only cells meeting a condition, use=COUNTIF(A2:A100,"<>"). - Lock references if you plan to copy across columns. Press F4 after selecting a reference to add dollar signs, for example
$A2or$A$2, so the test keeps pointing at the right column.
Common Mistakes
- Using ISBLANK alone.
=ISBLANK(A2)returns FALSE for a cell containing a formula that returns an empty string, and for a cell holding a single space. That surprises people who expect "looks empty" to mean "is empty." - Forgetting the quotes around the empty string.
A2<>on its own is a syntax error. The comparison target must be"". - Treating zero as blank. A cell containing 0 is not empty, and the
<>""test correctly returns your "not empty" result. If you actually wanted to exclude zeros, that is a different formula. - Leaving stray spaces. Data pasted from elsewhere often carries a trailing space, so a cell that looks blank is not.
=IF(TRIM(A2)<>"","Yes","No")handles that case. - Mixing up the true and false results. The order is
IF(test, value_if_true, value_if_false). Reversing the last two arguments is the most common cause of "my formula is backwards." - Comparing text to numbers. A number stored as text will pass the not-empty test but fail later arithmetic. Watch for the green triangle warning in the corner of the cell.
Tips
- Use
COUNTArather thanCOUNTwhen you want to know how many cells contain anything;COUNTonly counts numbers. - Name your helper column header something obvious like "Has value" so the sheet stays readable months later.
- If you need to flag blanks across an entire row, combine several not-empty tests with AND rather than nesting IFs inside IFs.
- Conditional formatting can highlight non-empty cells without any formula in a cell: select the range, open Conditional Formatting, and use a formula rule such as
=A2<>"". - Press Ctrl+` (the grave accent key) to toggle showing formulas instead of results — handy for checking a whole helper column at a glance.
- When sharing a workbook, note in a comment which columns are formula-driven so nobody pastes raw values over them.
Troubleshooting
The formula says "not empty" but the cell looks blank. The cell probably contains a space, a non-breaking space from a web page, or a formula returning "". Wrap the reference in TRIM, or select the cell and check the formula bar for hidden characters.
You see #NAME? instead of a result. A function name is misspelled or the quotes are curly rather than straight. Retype the formula rather than pasting it from a document that may have smart quotes.
You see #VALUE!. One of the arguments is the wrong type — usually a text result without quotes, or a reference to a cell containing an error. Check the referenced cell first.
The fill handle copies the same result everywhere. The references are absolute when they should be relative. Remove the dollar signs, or rewrite the formula with relative references.
Results do not update after you edit the source cell. Calculation may be set to Manual. Look in the Formulas tab for Calculation Options and set it to Automatic. This is a workbook setting, not a formula problem.
If that did not work, rebuild the formula in a clean cell one argument at a time, checking the result after each piece. It almost always reveals which reference or quote is wrong.
Frequently Asked Questions
What is the difference between ISBLANK and <>""?
ISBLANK is true only for a genuinely empty cell. The <>"" test is true for any cell with content, including formulas that return an empty string. For most reporting tasks, the not-equal-to-empty-string version is what you want.
Does a cell with a formula returning "" count as empty?
Not for ISBLANK, which returns FALSE, but yes for the <>"" test, which treats it as blank. That difference is the main reason the two formulas give different answers on the same sheet.
How do I count non-empty cells in a range?
Use =COUNTA(range) to count every cell with any content, or =COUNTIF(range,"<>") for a conditional count. Both ignore truly empty cells.
Can I return a blank instead of text when the cell is empty?
Yes. Put "" as the value_if_false argument, for example =IF(A2<>"",A2,""). The result looks empty but the cell still contains a formula, which matters if other formulas test it later.
Why does my formula treat a zero as not empty?
Because zero is a value. The not-empty test checks for content, not for truthiness. If you want to exclude zeros as well, add a second condition with AND.
Does this work in Google Sheets and Excel for the web?
Yes. The syntax =IF(A2<>"","Yes","No") behaves the same in Google Sheets and in Excel for the web, so formulas can usually be moved between them without changes.