# How to use ISTEXT in an IF formula in Excel

Return a message for text and calculate otherwise: =IF(ISTEXT(B2),"Check qty",B2*C2).

**Excel:** `=IF(ISTEXT(B2),"Check qty",B2*C2)` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| SKU | Qty | Unit price | Line total |
| A-10 | 12 | 4.5 |  |
| A-11 | TBC | 9 |  |
| A-12 | 5 | 12.25 |  |
| A-13 | backorder | 3.1 |  |
| A-14 | 8 | 6 |  |
| A-15 |  | 7.75 |  |

Formula in D2, filled to D7: `=IF(ISTEXT(B2),"Check qty",B2*C2)`

Result: $54.00; Check qty; $61.25; Check qty; $48.00; $0.00

## How it works

ISTEXT is TRUE when the cell holds text, like "TBC" or "backorder". IF returns the message for those rows instead of letting the multiplication fail with #VALUE!. An empty cell isn't text, so A-15 calculates as 0.

## Other ways

- `=IF(ISNUMBER(B2),B2*C2,"Check qty")`: Calculates only for real numbers, so empty quantities are flagged too. (A-15, with no quantity, shows "Check qty" instead of 0.)
- `=IFERROR(B2*C2,"Check qty")`: Lets the multiplication fail on text and catches the error. Shorter, but it hides other problems too.

## Common mistakes

- A number stored as text ("12") is text to ISTEXT, so it is flagged. That is usually right: fix the entry.
- A formula that returns "" counts as text for ISTEXT.

## Questions

**How do I check for one particular word instead of any text?**

Use SEARCH: `=IF(ISNUMBER(SEARCH("backorder",B2)),"On backorder",B2*C2)`.

**How do I count text entries in a column?**

`=COUNTIF(B2:B7,"*")` counts cells that contain text.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/istext-in-an-if-formula
