Check if cell contains specific text (IF + SEARCH)

Medium Logic
Description
Hints 0/5
Solutions 2
–
Test case
1
2
3
Reset
Submit
fx
A
B
C
D
E
F
G
1
2
3
4
5
6
7
8
9
10
Loading interactive spreadsheet...
Preparing grid cells and formula calculation engine
○ Ready Enter formula in highlighted cells, then click Submit.

The problem

Problem statement

Customer support needs to triage incoming tickets in A2:A5. If a ticket's message contains the word Urgent (case-insensitive), label it as Priority; otherwise, label it as Normal. Fill the Priority Status cells B2:B5 using an IF formula that checks for substring presence.

SEARCH looks anywhere in the text and ignores case — case 3 has a lowercase 'urgent' at the end and still needs Priority.

Problem data

Show the sheet as a table (selectable, copyable)
The exercise data, as a table
AB
1 Customer Ticket MessagePriority Status
2 Urgent: payment failed at checkout
3 Question about shipping address update
4 System error, please help urgent!
5 How to export monthly invoice?

Notes

Excel doesn't have a built-in CONTAINS() function. The standard industry pattern combines SEARCH and ISNUMBER: SEARCH("Urgent", A2) returns the character position if found, or #VALUE! if not found. Wrapping with ISNUMBER(...) converts the position into TRUE or FALSE, which cleanly feeds into IF.

How to approach

Your answer goes in B2:B5. On submit we re-run your formula against 3 different sets of input, so a hardcoded number will fail — the formula has to follow the cells.

  1. Target cells are B2:B5 — start in B2, then fill down
  2. SEARCH("Urgent", A2) finds where the word appears (case-insensitive)
  3. Wrap SEARCH with ISNUMBER: ISNUMBER(SEARCH("Urgent", A2))SEARCH("Urgent", A2)) returns TRUE if the word is present
  4. Use that expression as the logical_test of your IF statement
  5. True branch returns "Priority", false branch returns "Normal"

Official solutions

Show 2 solutions — try it yourself first

Approach 1: IF + ISNUMBER + SEARCH (Classic standard)

=IF(ISNUMBER(SEARCH("Urgent", A2)), "Priority", "Normal")

SEARCH looks for 'Urgent' case-insensitively. If found, it returns a number (e.g. 1); ISNUMBER turns that number into TRUE. If not found, SEARCH returns #VALUE! and ISNUMBER turns it into FALSE.

Approach 2: IF + COUNTIF with wildcards

=IF(COUNTIF(A2, "*Urgent*")>0, "Priority", "Normal")

COUNTIF with asterisks (*Urgent*) counts how many cells contain the word. If greater than 0, return Priority.

Function guide

Related practice

FAQ

Is there a CONTAINS function in Excel?

No. Excel does not have a native CONTAINS function. The universal method is =IF(ISNUMBER(SEARCH("text", cell)), value_if_true, value_if_false).

What is the difference between SEARCH and FIND in Excel?

SEARCH is case-insensitive ('urgent' matches 'Urgent'). FIND is strictly case-sensitive. In most business text classifications, SEARCH is preferred.

Can I check multiple words at once?

Yes. You can combine OR or SUM: =IF(OR(ISNUMBER(SEARCH("urgent", A2)), ISNUMBER(SEARCH("asap", A2))), "Priority", "Normal").