What is the ISTEXT function?
=ISTEXT(value)ISTEXT returns TRUE if a value is text. It is most often used inside IF to treat values differently by kind.
Column A of the sheet mixes text, numbers, a blank, a logical value, errors and text that looks like a number; column B says what each is. Column C shows the same formula copied down.
When a SUM refuses to add up after pasting data from another system, the cause is usually numbers stored as text. Put ISTEXT in a helper column and look for TRUE: those are the cells the calculation is skipping.
Arguments
- value
- The value or cell to test.
ISTEXT examples
Example 1. Check for text
=ISTEXT(A2)"Apple", so TRUE.
Example 2. Text that looks like a number
=ISTEXT(A8)"120" is stored as text, so TRUE. Handy for finding why a calculation fails.
Example 3. Result for each kind of value
=ISTEXT(A2)Only values stored as text are TRUE.
Value in column A =ISTEXT(A2) Apple TRUE 120 FALSE (blank) FALSE TRUE FALSE #N/A FALSE #DIV/0! FALSE "120" (text) TRUE Example 4. Count text cells
=SUMPRODUCT(--ISTEXT(A2:A10))In A2:A10 the result is 2: Apple and "120".
Common mistakes
Blank cells
A blank cell is not text, so FALSE.
Text that looks like a number
According to Microsoft, IS functions test the value without converting it, so "120" stored as text is text, not a number.
A leading apostrophe
A number typed as '120 is stored as text, so ISTEXT returns TRUE even though the cell shows 120.
FAQ
- The opposite?
- Use ISNONTEXT.
- How do I convert it to a number?
- Use VALUE.
- How do I convert many text numbers at once?
- Type 1 in a spare cell, copy it, select the range and use Paste Special > Multiply.