Cellwise

Excel guide · 3 min read

If a cell contains text, return a value in Excel

Use =IF(ISNUMBER(SEARCH("wireless",A2)),"Yes","No"). SEARCH returns the position of the word if it appears anywhere in A2 and an error if it does not; ISNUMBER turns that into TRUE or FALSE for IF. SEARCH ignores case; use FIND for a case-sensitive check.

Sample data

Every formula on this page was calculated live against this sheet.

ABC
1ProductPriceNotes
2Wireless Mouse M22024.99Refund issued
3USB-C Charging Cable12.5
4Mechanical Keyboard89Back order
5Wireless Keyboard K38039.99
6HDMI Cable 2m9.99refund pending
7Laptop Stand34

The standard formula: IF + ISNUMBER + SEARCH

A simple =IF(A2="wireless", ...) only matches when the whole cell is exactly "wireless". To find a word anywhere inside the cell, you need SEARCH.

SEARCH("wireless",A2) returns 1 for "Wireless Mouse M220" because the word starts at character 1. For "Laptop Stand" it returns #VALUE!. ISNUMBER converts those to TRUE and FALSE, and IF picks the result.

fx=IF(ISNUMBER(SEARCH("wireless",A2)),"Wireless","Wired")

Result: Wireless

A2 contains "Wireless" (case does not matter to SEARCH), so the result is Wireless.

Return a number from another cell

The value you return can be anything: text, a number, or another cell. This returns the price when the note mentions a refund and 0 otherwise, so you can total refunds with SUM.

Point SEARCH at a cell instead of typing the word, for example SEARCH($F$1,C2), and you can change the keyword without touching the formula.

fx=IF(ISNUMBER(SEARCH("refund",C2)),B2,0)

Result: 24.99

C2 says "Refund issued", so the formula returns the price from B2: 24.99.

Case-sensitive check with FIND

FIND works like SEARCH but cares about upper and lower case, and it does not support wildcards. Use it when "USB" and "usb" mean different things in your data.

fx=IF(ISNUMBER(FIND("USB",A3)),"Has USB","No")

Result: Has USB

A3 contains "USB" in capitals, so FIND returns a position and the result is Has USB.

Check for one of several words

Wrap one ISNUMBER(SEARCH()) per word inside OR. The cell is flagged if any of them appears. Swap OR for AND when every word must appear.

fx=IF(OR(ISNUMBER(SEARCH("usb",A6)),ISNUMBER(SEARCH("hdmi",A6))),"Cable","Other")

Result: Cable

A6 is "HDMI Cable 2m". The HDMI test is TRUE, so OR is TRUE and the result is Cable.

Count cells that contain a word

If you need a count rather than a label on each row, COUNTIF with asterisk wildcards does it in one cell. The asterisk means "any characters", so "*keyboard*" matches the word anywhere in the cell. COUNTIF also ignores case.

fx=COUNTIF(A2:A7,"*keyboard*")

Result: 2

Two products contain "keyboard": the mechanical one and the K380.

Which method to pick

Need a label or value on each row? Use IF with ISNUMBER and SEARCH. Need it to respect capitals? Swap SEARCH for FIND. Need a single total? COUNTIF or SUMIF with "*word*" is shorter and does not need a helper column. In Excel 365, FILTER can pull out every matching row at once if you want a list rather than a flag.

Whichever you choose, keep the keyword in its own cell and refer to it. Then anyone can change what is being searched for without editing formulas.

Common mistakes

Using wildcards with an equals sign

=IF(A2="*wireless*", ...) looks for a literal asterisk. Wildcards only work inside functions like COUNTIF, SUMIF and XLOOKUP. Use ISNUMBER(SEARCH()) in IF.

Short keywords matching inside other words

Searching for "cab" also matches "cable". Add spaces around the keyword or search a longer phrase if that matters.

Leaving out ISNUMBER

=IF(SEARCH("x",A2),...) returns #VALUE! whenever the word is missing, because the error passes straight through IF.

FAQ

How do I check if a cell contains any text at all?

Use =IF(ISTEXT(A2),"Text","Not text"). ISTEXT is TRUE for any text, including numbers stored as text, and FALSE for real numbers and empty cells.

Is SEARCH case-sensitive?

No. SEARCH ignores case and allows wildcards. FIND is the case-sensitive version.

Can I highlight cells that contain a word instead?

Yes. Select the range, then Home > Conditional Formatting > Highlight Cells Rules > Text that Contains, and type the word.

Functions used

Keep learning

Updated 2026-10-31