Logical
ISTEXT
Definition
ISTEXT returns TRUE when its argument is text, and FALSE otherwise.
Syntax
=ISTEXT(value)
Arguments
| Argument | Meaning |
|---|---|
value |
The cell or result to test. |
Worked example
A lumber yard lists labels that should be words. Labels are in A2:A4.
| A: Label |
|---|
| Oak |
| 12 |
| Pine |
Formula: =IF(ISTEXT(A2),1,0)
Result: 1. Oak is text, so ISTEXT is true and IF returns 1. Filled down, the formula gives 1, 0, and 1.
Practice
Cell A2 holds Hi. In B2, write a formula that returns 1 when A2 is text and 0 otherwise.
- In B2, write an IF formula that uses ISTEXT and shows 1 when A2 is text, and 0 otherwise.
- B2 should show the result for Hi.
Step 1 of 2
Enter =IF(ISTEXT(A2),1,0) in B2.
A2 is Hi, which is text, so the result is 1.
Formulas here use English function names, such as SUM, and a period as the decimal separator, in every language.
Loading the sheet…
B2 uses ISTEXT.
B2 now shows 1.
Related functions
ISNUMBER is the matching test for numeric cells. IF wraps either test when you want 1 or 0.
Common mistake
Checking ISTEXT on a number stored as text, such as '12, and expecting FALSE: that cell is text, so ISTEXT is TRUE.