ISTEXT

Information
(4.8/5)

The ISTEXT function returns TRUE if a value is text, and FALSE otherwise. It correctly identifies text values including empty strings, but returns FALSE for numbers, dates, times, errors, blank cells, Boolean values, and formulas that return non-text results. This function is essential for type checking before performing text operations.

Interactive Formula Tester

=ISTEXT("")

Complete Theory & Understanding

Master the fundamentals of Excel ISTEXT function

Core Concept

The ISTEXT function is crucial for type checking and data validation in Excel. Understanding what ISTEXT considers "text" is important for building robust formulas that handle mixed data types. This function is particularly valuable when processing imported data, user input, or data from external sources where data types may be inconsistent.

Why Use ISTEXT?

  • ISTEXT returns TRUE for: any text string ("Hello", "123"), empty strings (""), text that looks like numbers ("123"), formulas that return text (TEXT functions, CONCATENATE results), and text values from functions or cell references. It returns FALSE for: actual numbers (123), dates and times (stored as numbers), errors (#N/A, #VALUE!, etc.), blank cells (ISBLANK returns TRUE, ISTEXT returns FALSE), Boolean values (TRUE/FALSE are numbers), and formulas that return numbers or errors.
  • A critical distinction: ISTEXT("") returns TRUE because empty strings are text, but ISTEXT(blank_cell) returns FALSE. ISBLANK returns TRUE for blank cells but FALSE for empty strings. This distinction is crucial when validating data: use ISBLANK for truly empty cells, use ISTEXT with ="" to check for empty text formulas.
  • ISTEXT distinguishes between text that looks like numbers ("123") and actual numbers (123). Text numbers return TRUE, actual numbers return FALSE. This is important when importing data where numbers may be stored as text. Use ISTEXT to identify these cases, then VALUE or NUMBERVALUE to convert them.
  • ISTEXT is essential for: validating text input in forms, ensuring data types before text operations (LEFT, RIGHT, MID, etc.), data cleaning to identify text values that need conversion, conditional text processing based on type, and type checking in complex formulas that handle mixed data.

Key Characteristics

What ISTEXT Considers Text

ISTEXT returns TRUE for: any text string ("Hello", "123"), empty strings (""), text that looks like numbers ("123"), formulas that return text (TEXT functions, CONCATENATE results), and text values from functions or cell references. It returns FALSE for: actual numbers (123), dates and times (stored as numbers), errors (#N/A, #VALUE!, etc.), blank cells (ISBLANK returns TRUE, ISTEXT returns FALSE), Boolean values (TRUE/FALSE are numbers), and formulas that return numbers or errors.

Example 1

Empty Strings vs Blank Cells

A critical distinction: ISTEXT("") returns TRUE because empty strings are text, but ISTEXT(blank_cell) returns FALSE. ISBLANK returns TRUE for blank cells but FALSE for empty strings. This distinction is crucial when validating data: use ISBLANK for truly empty cells, use ISTEXT with ="" to check for empty text formulas.

Example 2

Text Numbers vs Actual Numbers

ISTEXT distinguishes between text that looks like numbers ("123") and actual numbers (123). Text numbers return TRUE, actual numbers return FALSE. This is important when importing data where numbers may be stored as text. Use ISTEXT to identify these cases, then VALUE or NUMBERVALUE to convert them.

Example 3

Data Validation Applications

ISTEXT is essential for: validating text input in forms, ensuring data types before text operations (LEFT, RIGHT, MID, etc.), data cleaning to identify text values that need conversion, conditional text processing based on type, and type checking in complex formulas that handle mixed data.

Example 4

Performance and Best Practices

ISTEXT is very efficient and works seamlessly with array formulas. Combine with IF for conditional logic, and with AND/OR for complex validation rules. When processing mixed data, use ISTEXT to branch logic: text values get text processing, numbers get numeric processing. This prevents errors and improves formula robustness.

Example 5

Function Anatomy

=ISTEXT(parameters...)
Required
Parameters:

Function-specific parameters

Returns
Return Value:

Function-specific return type

Primary Use Cases

What ISTEXT Considers Text

ISTEXT returns TRUE for: any text string ("Hello", "123"), empty strings (""), text that looks like numbers ("123"), formulas that return text (TEXT functions, CONCATENATE results), and text values from functions or cell references. It returns FALSE for: actual numbers (123), dates and times (stored as numbers), errors (#N/A, #VALUE!, etc.), blank cells (ISBLANK returns TRUE, ISTEXT returns FALSE), Boolean values (TRUE/FALSE are numbers), and formulas that return numbers or errors.

Empty Strings vs Blank Cells

A critical distinction: ISTEXT("") returns TRUE because empty strings are text, but ISTEXT(blank_cell) returns FALSE. ISBLANK returns TRUE for blank cells but FALSE for empty strings. This distinction is crucial when validating data: use ISBLANK for truly empty cells, use ISTEXT with ="" to check for empty text formulas.

Text Numbers vs Actual Numbers

ISTEXT distinguishes between text that looks like numbers ("123") and actual numbers (123). Text numbers return TRUE, actual numbers return FALSE. This is important when importing data where numbers may be stored as text. Use ISTEXT to identify these cases, then VALUE or NUMBERVALUE to convert them.

Data Validation Applications

ISTEXT is essential for: validating text input in forms, ensuring data types before text operations (LEFT, RIGHT, MID, etc.), data cleaning to identify text values that need conversion, conditional text processing based on type, and type checking in complex formulas that handle mixed data.

Theory Summary

Precise

Exact matching required

Position-Based

Returns numeric position

Error-Safe

Handles missing text gracefully

Syntax & Parameters

=ISTEXT(value)
Required
value:

The value, cell reference, or expression to check. This can be any value type that Excel might contain.

Returns
Return Value:

TRUE if the value is text (including empty strings ""), FALSE if the value is a number, date, time, error, blank, Boolean, or any non-text type

Description: ISTEXT(value)

Interactive Examples

Basic ISTEXT check

Basic ISTEXT check

""
=ISTEXT(A1)
TRUE if A1 contains text, FALSE otherwise

The most common use case. Checks if cell A1 contains a text value. Returns TRUE for any text, including empty strings, and FALSE for numbers, dates, errors, or blank cells.

VBA Implementation & Automation

ISTEXT VBA Example

VBA implementation for ISTEXT.

Sub ISTEXTExample()
    ' Method 1: Using TypeName (most reliable)
    Dim result As Boolean
    result = TypeName(Range("A1").Value) = "String"
    MsgBox "Is A1 text (TypeName): " & result
    
    ' Method 2: Using WorksheetFunction.IsText
    Dim wsResult As Boolean
    wsResult = Application.WorksheetFunction.IsText(Range("A1").Value)
    MsgBox "Is A1 text (WorksheetFunction): " & wsResult
    
    ' Method 3: Using VarType
    Dim cellValue As Variant
    cellValue = Range("A1").Value
    Dim varTypeResult As Boolean
    varTypeResult = (VarType(cellValue) = vbString)
    MsgBox "Is A1 text (VarType): " & varTypeResult
    
    ' Method 4: Comprehensive type checking
    Dim inputValue As Variant
    inputValue = Range("A1").Value
    
    Select Case TypeName(inputValue)
        Case "String"
            MsgBox "Text value: " & inputValue
            ' Safe to perform text operations
            Range("B1").Value = UCase(inputValue)
        Case "Double", "Integer", "Long", "Single", "Currency"
            MsgBox "Numeric value: " & inputValue
            ' Convert to text if needed
            Range("B1").Value = CStr(inputValue)
        Case "Boolean"
            MsgBox "Boolean value: " & inputValue
        Case "Date"
            MsgBox "Date value: " & inputValue
        Case "Empty"
            MsgBox "Empty cell"
        Case Else
            MsgBox "Other type: " & TypeName(inputValue)
    End Select
    
    ' Method 5: Check and process text values in range
    Dim cell As Range
    Dim textCount As Integer
    textCount = 0
    
    For Each cell In Range("A1:A10")
        If TypeName(cell.Value) = "String" Then
            textCount = textCount + 1
            ' Process text cell
            cell.Offset(0, 1).Value = "Text: " & cell.Value
        End If
    Next cell
    
    MsgBox "Found " & textCount & " text values in range A1:A10"
End Sub

Business Applications

Data validation to ensure cells contain text values before text operations

Data validation to ensure cells contain text values before text operations

ISTEXT(value)

Type checking to identify text data in mixed-type datasets

Type checking to identify text data in mixed-type datasets

ISTEXT(value)

Conditional text processing based on data type

Conditional text processing based on data type

ISTEXT(value)

Data cleaning to identify and handle text values appropriately

Data cleaning to identify and handle text values appropriately

ISTEXT(value)

Form validation requiring text input fields

Form validation requiring text input fields

ISTEXT(value)

Building robust formulas that safely handle mixed data types

Building robust formulas that safely handle mixed data types

ISTEXT(value)

Text manipulation workflows that need to verify text type first

Text manipulation workflows that need to verify text type first

ISTEXT(value)

Data import validation to check text columns

Data import validation to check text columns

ISTEXT(value)

Common Issues & Solutions

ISTEXT returns FALSE for values that look like text

ISTEXT returns FALSE for values that look like text

Solution: The cell likely contains a number formatted as text, or a formula returning a number. Check the formula bar - if it shows a number without quotes, it's numeric. Use TEXT function to convert: =ISTEXT(TEXT(A1,"0")).

ISTEXT returns TRUE for empty cells when expecting FALSE

ISTEXT returns TRUE for empty cells when expecting FALSE

Solution: ISTEXT returns FALSE for truly blank cells. If you're seeing TRUE, the cell likely contains a formula returning an empty string (=""). Use ISBLANK to check for truly empty cells.

ISTEXT not working with imported text data

ISTEXT not working with imported text data

Solution: Imported data may contain hidden characters, non-breaking spaces, or formatting issues. Use TRIM and CLEAN: =ISTEXT(TRIM(CLEAN(A1))). Also verify the data actually contains text and not formatted numbers.

ISTEXT returns different results for similar values

ISTEXT returns different results for similar values

Solution: Cells may contain invisible characters, formatting, or be the result of different formulas. Use TRIM, CLEAN, and LEN to inspect values. Check formulas in cells to see what they actually return.

ISTEXT with formulas showing unexpected results

ISTEXT with formulas showing unexpected results

Solution: ISTEXT checks the formula's result, not the formula itself. If a formula like =123 returns a number, ISTEXT will return FALSE even if displayed as text. Verify what the formula actually returns, not its displayed format.

Performance Tips & Best Practices

⚡ Performance Optimization

  • ISTEXT is very efficient with minimal performance impact
  • Use ISTEXT before text operations (LEFT, RIGHT, MID, etc.) to prevent errors
  • Combine with IF for conditional logic: =IF(ISTEXT(A1), text_operation, alternative)
  • Use ISTEXT in array formulas to efficiently identify text values across ranges
  • For empty string checks, use ISTEXT with ="": =ISTEXT(A1) AND A1=""
  • In data validation rules, ISTEXT provides fast text type checking
  • Combine with other IS functions (ISNUMBER, ISBLANK) for comprehensive type validation