ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Logic
  3. ISNUMBER and SEARCH: Check if a Cell Contains Text

ISNUMBER and SEARCH: Check if a Cell Contains Text

By ExcelReady Team·Updated November 2, 2026·7 min read

The short answer

Use =ISNUMBER(SEARCH("refund",B2)). SEARCH looks for the text inside B2 and returns its position as a number, or a #VALUE! error if it isn't there. ISNUMBER turns that into TRUE or FALSE. Wrap it in IF to show your own labels, and swap SEARCH for FIND when capitals must match exactly.

Key takeaways

  • =ISNUMBER(SEARCH("text",cell)) returns TRUE if the cell contains the text anywhere, and FALSE if not.
  • SEARCH ignores capitals; FIND is case-sensitive. Both work inside ISNUMBER.
  • Wrap the test in IF to return labels: =IF(ISNUMBER(SEARCH("refund",B2)),"Refund","Other").
  • An empty search text matches every cell, because SEARCH("",B2) returns 1.
  • The same test works in conditional formatting, FILTER and SUMPRODUCT.
On this page+
  1. How ISNUMBER and SEARCH work together
  2. The sample data
  3. How to return your own labels with IF
  4. How to make the check case-sensitive
  5. How to check that a cell does not contain text
  6. How to check for several words
  7. How to use the test in FILTER, counts and highlighting
  8. Common problems and how to fix them
  9. Practise it

ISNUMBER with SEARCH is the standard Excel way to check if a cell contains some text: =ISNUMBER(SEARCH("refund",B2)) returns TRUE when "refund" appears anywhere in B2 and FALSE when it doesn't. It works in every Excel version and ignores capitals. This guide explains why the two functions work together, then shows the test inside IF, with several words, case-sensitive, and in FILTER and counts.

How ISNUMBER and SEARCH work together#

SEARCH finds text and returns a position; ISNUMBER turns that position into TRUE or FALSE. On their own, each function is only half the answer.

SEARCH looks for one piece of text inside another:

Excel formula
=SEARCH(find_text, within_text, [start_num])

If it finds the text, it returns the position of the first character. If not, it returns a #VALUE! error. ISNUMBER checks whether a value is a number and returns TRUE or FALSE. It never returns an error itself.

Put together, the two possible SEARCH results become a clean answer:

B2SEARCH("refund",B2)ISNUMBER(SEARCH("refund",B2))
Refund request for order 44711TRUE
Login problem#VALUE!FALSE
Where is my refund?13TRUE
Return and REFUND please12TRUE

The SEARCH function guide and the ISNUMBER function guide cover each function's arguments.

The sample data#

The examples below use this list of support tickets in A1:B7:

AB
1TicketSubject
2T-201Refund request for order 4471
3T-202Login problem
4T-203Where is my refund?
5T-204Change delivery address
6T-205Return and REFUND please
7T-206Invoice copy needed

Three subjects mention a refund (rows 2, 4 and 6), with different capitals and in different places.

How to return your own labels with IF#

TRUE and FALSE are fine for checking, but reports usually need words. Wrap the test in IF:

Excel formula
=IF(ISNUMBER(SEARCH("refund",B2)),"Refund","Other")

Fill it down (Windows: Ctrl+D; Mac: ⌘D). Rows 2, 4 and 6 show Refund; the rest show Other.

You don't need =TRUE inside the IF. ISNUMBER already returns TRUE or FALSE, which is exactly what IF's first argument expects. To read the search word from a cell instead, such as E1, write SEARCH($E$1,B2). Lock it with $ so it stays put as you fill down.

How to make the check case-sensitive#

Use FIND instead of SEARCH. FIND works the same way, but "Refund" and "REFUND" are different to it.

Excel formula
=ISNUMBER(FIND("Refund",B2))

Only row 2 returns TRUE. Row 4 has "refund" in lower case and row 6 has "REFUND" in capitals, so FIND returns #VALUE! and ISNUMBER returns FALSE. The comparison of FIND vs SEARCH covers the other differences, such as wildcards.

How to check that a cell does not contain text#

Wrap the test in NOT to flip TRUE and FALSE. This returns TRUE for the subjects that don't mention a refund:

Excel formula
=NOT(ISNUMBER(SEARCH("refund",B2)))

Rows 3, 5 and 7 return TRUE. You may also see =ISERROR(SEARCH("refund",B2)), which gives the same result, because SEARCH returns an error exactly when the text is missing. Either works; the NOT version reads more clearly next to the "contains" formulas. Use it in IF to label the rest, or in FILTER to list the tickets that are not refunds.

How to check for several words#

Join tests with OR when any of the words is enough, and with AND when all must appear.

Excel formula
=OR(ISNUMBER(SEARCH("refund",B2)),ISNUMBER(SEARCH("return",B2)))

This is TRUE for rows 2, 4 and 6. Row 6 contains both words, which still counts once.

Excel formula
=AND(ISNUMBER(SEARCH("return",B2)),ISNUMBER(SEARCH("refund",B2)))

This is TRUE only for row 6, the one subject that mentions both.

For a longer list of words, an array constant keeps the formula short:

Excel formula
=SUMPRODUCT(--ISNUMBER(SEARCH({"refund","return","cancel"},B2)))>0

SEARCH checks each word, ISNUMBER gives TRUE or FALSE for each, -- turns those into 1s and 0s, and SUMPRODUCT adds them. If the total is above 0, at least one word was found.

How to use the test in FILTER, counts and highlighting#

Because ISNUMBER(SEARCH()) returns TRUE or FALSE, it slots into any tool that needs a condition.

Count matching cells. This returns 3:

Excel formula
=SUMPRODUCT(--ISNUMBER(SEARCH("refund",B2:B7)))

=COUNTIF(B2:B7,"*refund*") gives the same count with wildcards, but the SEARCH version can be made case-sensitive by swapping in FIND.

Filter matching rows. In Excel 2021 or Microsoft 365:

Excel formula
=FILTER(A2:B7,ISNUMBER(SEARCH("refund",B2:B7)))

This spills the three refund tickets into a new list. The guide to filtering rows that contain text builds a search box with this pattern.

Highlight matching cells. Use the same test as a conditional formatting rule, as shown in how to highlight cells that contain specific text.

Common problems and how to fix them#

Most surprises with ISNUMBER SEARCH come from what SEARCH matches, not from ISNUMBER.

  1. Every row returns TRUE. The search text is empty, often because it points at a blank cell. SEARCH("",B2) returns 1. Guard it: =AND($E$1<>"",ISNUMBER(SEARCH($E$1,B2))). A cell holding "" from a formula counts as empty text here too; see ISBLANK vs an empty string.
  2. Partial words match. SEARCH finds text anywhere, so "art" matches "start" and "party". Search for " art " with spaces, or add a space to both sides of the cell: SEARCH(" art "," "&B2&" ").
  3. Wildcards behave oddly. In SEARCH, ? and * are wildcards. To find a real question mark, put a tilde before it: SEARCH("~?",B2).
  4. Numbers in the cell. SEARCH treats numbers as text, so SEARCH("44",B2) finds "4471". That is usually what you want, but be careful with short numbers.
  5. Hidden spaces or line breaks. A word split by a line break may not match. Clean the text first with TRIM and CLEAN.

For more text-finding tricks, see how to find text with FIND and SEARCH.

Practise it#

Try the exercise on this page: build the IF, ISNUMBER and SEARCH formula from the inside out. Then practise FIND and SEARCH in a live spreadsheet to locate text and pull out parts of it, and practise IS functions and SWITCH to test values with ISNUMBER, ISTEXT and ISBLANK. Each lesson checks your formula instantly.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Label each support ticket. In C2, return Refund if the subject in B2 contains the word refund, otherwise Other. Use IF, ISNUMBER and SEARCH.

fx
ABCD
1
Ticket
Subject
Type
2
T-201
Refund request for order 4471
3
T-202
Login problem
4
T-203
Where is my refund?
5
T-204
Change delivery address
6
T-205
Return and REFUND please
7
T-206
Invoice copy needed
8
9
10

Tip: Build it from the inside: SEARCH("refund",B2), then ISNUMBER(...), then IF(..., "Refund", "Other").

Practise this in a lesson

LessonFIND and SEARCHLocate a character or word inside text with FIND or SEARCH, then use that position to split names and pull out order numbers.LessonIS functions and SWITCHCheck what's really in a cell with ISBLANK, ISNUMBER and ISTEXT, and turn short codes into labels with SWITCH.Function guideISNUMBERUse ISNUMBER to catch numbers stored as text and, with SEARCH, to test whether a cell contains a word. Examples, pitfalls and live practice.Function guideSEARCHLocate text regardless of capitals with Excel's SEARCH, use wildcards, and build "contains" checks with ISNUMBER. Examples and live practice.

Frequently asked questions

How do I check if a cell contains specific text in Excel?

+

Use =ISNUMBER(SEARCH("text",A2)). It returns TRUE if the text appears anywhere in A2 and FALSE if it doesn't. SEARCH ignores capitals.

Why do you need ISNUMBER with SEARCH?

+

SEARCH returns a position number when it finds the text and a #VALUE! error when it doesn't. ISNUMBER turns those two outcomes into a clean TRUE or FALSE that IF, FILTER and conditional formatting can use.

How do I make ISNUMBER SEARCH case-sensitive?

+

Replace SEARCH with FIND: =ISNUMBER(FIND("Refund",A2)). FIND only matches the exact capitals, so refund and REFUND would return FALSE.

How do I check if a cell contains one of several words?

+

Join two tests with OR: =OR(ISNUMBER(SEARCH("refund",A2)),ISNUMBER(SEARCH("return",A2))). It returns TRUE if either word appears.

Why does ISNUMBER SEARCH return TRUE for every cell?

+

The search text is probably empty, for example a reference to a blank cell. SEARCH("",A2) returns 1, which is a number. Add a check such as AND(G1<>"",ISNUMBER(SEARCH(G1,A2))).

Sources

  • SEARCH, SEARCHB functions - Microsoft Support
  • IS functions - Microsoft Support
  • FIND, FINDB functions - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How ISNUMBER and SEARCH work together
  2. The sample data
  3. How to return your own labels with IF
  4. How to make the check case-sensitive
  5. How to check that a cell does not contain text
  6. How to check for several words
  7. How to use the test in FILTER, counts and highlighting
  8. Common problems and how to fix them
  9. Practise it

Keep reading

Text· 7 min read

Find the Position of Text in a Cell (FIND and SEARCH)

FIND and SEARCH return the position of some text inside a cell, as a number. =FIND(" ",A2) gives 5 for Dana Whitfield, because the space is the 5th character. FIND is case-sensitive; SEARCH ignores capitals and allows wildcards. Both return #VALUE! when the text isn't there, so wrap them in ISNUMBER to test whether a cell contains a word.

Comparisons· 8 min read

FIND vs SEARCH in Excel

FIND and SEARCH both return the position of some text inside a cell. FIND is case-sensitive and treats * and ? as normal characters. SEARCH ignores capitals and supports the wildcards * and ?. Use SEARCH for most "does this cell contain a word" checks, and FIND when capital letters matter.

Dynamic arrays· 6 min read

FILTER Rows That Contain Text in Excel

To filter rows that contain text in Excel, combine FILTER with ISNUMBER and SEARCH: =FILTER(A2:C8,ISNUMBER(SEARCH("desk",A2:A8))). SEARCH returns a position where the text is found and an error where it isn't, and ISNUMBER turns that into TRUE or FALSE for each row. Use FIND instead of SEARCH for a case-sensitive match. FILTER needs Excel 2021 or Microsoft 365.

More on logic

  • Nested IF in Excel: Grades, Bands and Tiers
  • Pass/Fail Formula in Excel With IF
  • Status Formula in Excel: Overdue, Due Soon or Done
  • The SWITCH Function in Excel (Turn Codes Into Labels)
  • TRUE and FALSE in Excel: What They Mean in Formulas
  • XOR Function in Excel: Exactly One Condition True
All logic articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free