Excel Test Cell Content: How to Check Values and Types

How-to basics · Updated November 18, 2026

To test what a cell contains in Excel, use a formula suited to the question: =ISBLANK(A2) checks whether A2 is truly empty, =ISTEXT(A2) checks for text, and =ISNUMBER(A2) checks for a number. Put the formula in another cell, replacing A2 with the cell you want to inspect; the result is usually TRUE or FALSE.

What “test cell content” can mean

Excel cells can hold numbers, text, dates, logical values such as TRUE, formulas, or errors. A cell may also look empty while containing a formula that displays an empty string, or appear to contain a number while actually storing text. So there is no single test that answers every question. Choose a check based on what you need to know: whether the cell is empty, what kind of value it holds, whether it matches a particular value, or whether it contains a particular word.

These checks are useful in data cleanup, validation, reporting, and formulas that should behave differently for different inputs. For example, a status column might need to flag blank entries, a sales report might need to distinguish numeric amounts from text, and an import check might need to find records containing a particular phrase.

In the examples below, the test formula goes in a separate cell, such as B2, while A2 is the cell being tested. Copying the formula down a column will adjust the reference for each row. If your regional Excel settings use semicolons as formula separators, Excel may require semicolons instead of commas in formulas with multiple arguments.

Check whether a cell is empty

Use ISBLANK when you need to know whether a cell has no value and no formula. With the value to check in A2, =ISBLANK(A2) returns TRUE if A2 is genuinely empty and FALSE if it contains text, a number, or a formula. This distinction matters because a cell that looks empty is not necessarily blank to Excel.

For example, if A2 contains the formula =IF(C1=0,"",C1), it may display nothing, but ISBLANK(A2) returns FALSE because A2 contains a formula. To test whether a cell is empty in appearance—including a formula result that is an empty string—compare it with an empty string. With the value to check in A2, =A2="" returns TRUE for a genuinely blank cell or a cell whose formula returns an empty string.

That comparison can be helpful when a report should treat both kinds of cells as missing. However, it does not identify cells containing only spaces. If a user has typed spaces into A2, the cell is not empty and the comparison returns FALSE. For a test that also treats ordinary spaces as empty, with the value to check in A2, use =LEN(TRIM(A2))=0. It returns TRUE for a blank, an empty-string result, or text made only of ordinary spaces. Excel’s TRIM function does not remove every possible whitespace character, such as a nonbreaking space copied from some web pages, so unusual imported spacing may need additional cleanup.

For a simple label rather than a TRUE/FALSE result, with A2 as the cell being checked, enter =IF(ISBLANK(A2),"Empty","Has content"). The result is “Empty” when A2 is genuinely blank and “Has content” otherwise. If you want formulas that display nothing to count as empty too, use the comparison with an empty string inside IF instead of ISBLANK.

Identify the value type

Excel’s type-checking functions help distinguish text, numbers, logical values, and errors. With the value to inspect in A2, =ISTEXT(A2) returns TRUE when Excel recognizes the value as text. This includes words, codes such as “AB-12,” and numbers stored as text. A cell containing the text “42” is not the same as a cell containing the numeric value 42, even if both look similar on the worksheet.

To check for a numeric value, with the value to inspect in A2, use =ISNUMBER(A2). It returns TRUE for a number and FALSE for text that merely looks like a number. Excel stores dates as serial numbers, so ISNUMBER also returns TRUE for a valid date value. This is expected: dates are formatted numbers in Excel, not a separate underlying value type.

Other type checks can narrow down what you are looking at. With the candidate value in A2, =ISLOGICAL(A2) returns TRUE for the logical values TRUE or FALSE, while =ISERROR(A2) returns TRUE if A2 contains an Excel error. These checks are useful when imported data or a calculation may produce values that need separate handling. They do not tell you why an error occurred; they only establish that the cell contains an error value.

When a number appears to be stored as text, test it before changing the data. Look for clues such as a warning indicator, inconsistent alignment, or formulas that do not treat the entry as expected. If you confirm the issue, Excel’s Convert to Number option may be available from the warning menu, or you can use Data > Text to Columns for certain imported data. Check the result afterward, since conversion can affect identifiers that must retain leading zeroes, such as postal codes or product numbers.

Test for a particular value

To check whether a cell equals a specific entry, use a comparison. With the value to test in A2, =A2="Ready" returns TRUE if A2 matches Ready and FALSE otherwise. Excel’s ordinary text comparison is not case-sensitive, so “ready” also matches. A comparison is convenient in an IF formula, a helper column, or a larger calculation.

If capitalization must match exactly, use EXACT instead. With the candidate text in A2, =EXACT(A2,"Ready") returns TRUE for “Ready” but FALSE for “ready.” EXACT is case-sensitive, which is useful for checking codes or labels where uppercase and lowercase characters are meaningful. It compares text exactly; it is not a general test for whether two values have the same data type.

For instance, suppose A2:A4 contain Ready, ready, and Waiting. The ordinary comparison returns TRUE for the first two entries, while EXACT returns TRUE only for the first. That difference can prevent a subtle mistake when a system treats identifiers or status codes as case-sensitive.

Find text within a cell

Sometimes the question is not whether a cell equals a phrase, but whether the phrase appears anywhere inside it. SEARCH finds text within another text value and ignores capitalization. With a description in A2, =IFERROR(SEARCH("urgent",A2)>0,FALSE) returns TRUE for text such as “Urgent: call the supplier” and FALSE if urgent does not appear. SEARCH returns a position number when it finds the phrase and an error when it does not, so IFERROR converts the not-found result into FALSE.

SEARCH is not case-sensitive. If capitalization matters, Excel’s FIND function performs a case-sensitive search. Both functions can interpret certain characters as wildcards: an asterisk can stand for any sequence of characters and a question mark can stand for one character. If you need to search for one of those symbols literally, use a tilde before it. This is worth remembering when searching product descriptions or filenames that contain punctuation.

A search result is different from a whole-cell match. If A2 contains “Urgent: call the supplier,” it does not equal “urgent,” but it does contain that word. Use an equality test for the first question and a search function for the second.

Test for errors without hiding them

Errors such as #N/A, #VALUE!, and #DIV/0! can flow into later calculations. With the result or input to inspect in A2, =ISERROR(A2) returns TRUE for any Excel error and FALSE for a non-error value. That makes it useful in a diagnostic column when you want to identify problem rows without changing the original data.

IFERROR can also provide an alternate result when a calculation fails, but it changes what the reader sees. For example, replacing every error with a blank may make a report look cleaner while concealing a missing lookup or invalid calculation. During troubleshooting, consider identifying the errors first and preserving enough information to correct their cause. Use a fallback only when that behavior is appropriate for the workbook.

Choose the right test for the task

Before building a larger formula, decide what “has content” or “is valid” means in your situation. A blank test, a type test, and a match test answer different questions. A cell holding the number 0 has content, ISNUMBER returns TRUE, and a test for equality with an empty string is not the same as a test for zero.

  • Use ISBLANK to detect cells with no entry or formula.
  • Use a comparison with an empty string when a formula returning nothing should count as empty.
  • Use ISTEXT or ISNUMBER to distinguish text from numeric values.
  • Use equality to test a complete value, or EXACT when text capitalization must match.
  • Use SEARCH or FIND to look for text inside a longer entry.
  • Use ISERROR to flag errors for review.

Test the formula against representative examples before copying it through a large data set. Include a truly blank cell, a formula that returns an empty string, a cell containing spaces, a numeric value, a number stored as text, and any error or unusual entry your workbook may contain. This small check helps confirm that the formula matches the practical meaning of “empty,” “text,” or “valid” for your data.

Common problems and useful checks

A frequent source of confusion is a cell that looks blank but fails ISBLANK. Check the formula bar or select the cell to see whether it contains a formula, spaces, or an invisible character. If the cell is formula-driven, compare it with an empty string; if it may contain ordinary spaces, TRIM can help. For pasted data with nonstandard spaces, a cleanup step may be needed before the test works as expected.

Another common problem is mixing numeric values and numbers stored as text. These can sort differently, behave differently in arithmetic, and produce unexpected results in comparisons. Use ISTEXT and ISNUMBER in a helper column to locate inconsistent entries, then decide whether conversion is appropriate. Do not automatically convert every text-looking number: leading zeroes in IDs and codes may be meaningful.

Also check that the reference points to the intended cell. When you copy a formula down, relative references such as A2 change to A3, A4, and so on. If the test should always inspect one fixed cell, use an absolute reference such as $A$2. In Microsoft 365 for Windows, formulas are entered in a worksheet cell or the formula bar; the same functions are available in Excel for Mac, although ribbon layout and some interface details can differ. Excel for the web also supports these standard functions.

Frequently Asked Questions

How do I check if a cell is not blank?
Use ISBLANK and test whether its result is FALSE, or wrap it in IF to display a label. Decide whether a formula returning an empty string should count as blank; ISBLANK treats that cell as nonblank.

How can I tell whether a cell contains a number or text?
Use ISNUMBER for numeric values and ISTEXT for text. A value such as the text “007” is text, not a number, even though it consists of digits. This distinction matters when calculating or preserving leading zeroes.

Why does ISBLANK return FALSE when the cell looks empty?
The cell may contain a formula that returns an empty string, spaces, or another invisible character. Select it and inspect the formula bar. Comparing the cell with an empty string handles formula results that display nothing, while TRIM can handle ordinary spaces.

How do I check whether a cell contains a word?
Use SEARCH for a case-insensitive search within the cell, and FIND if capitalization matters. A search checks for text inside a longer entry; it does not require the whole cell to equal the word.

Can Excel test whether a cell contains an error?
Yes. ISERROR returns TRUE for an Excel error value and FALSE otherwise. It identifies the presence of an error but does not explain its cause, so inspect the original formula or input to diagnose the problem.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

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

Spotted an error in this guide? Let us know.