In Google Sheets, check whether a cell contains a particular word or phrase with =ISNUMBER(SEARCH("urgent",TO_TEXT(A2))). It returns TRUE when A2 contains “urgent” anywhere, regardless of capitalization; use it inside IF to return a label or result instead.
What “contains text” can mean
The right formula depends on what you mean by “text.” You may want to find a particular word inside a longer entry, check whether a cell’s value is text at all, or test whether it contains any letters. These are different checks, and choosing the right one avoids misleading results.
- Contains a phrase: Look for a smaller string anywhere in the cell, such as “urgent” in “Urgent: call the supplier.”
- Is a text value: Check the cell’s data type, not whether it includes a specific word.
- Contains any letters: Check for alphabetic characters, even when you do not know which word to search for.
For many everyday tasks, such as flagging notes that mention a product or status, a substring search is what people intend. If you only need to tell text values from numbers or dates, use a type-checking function instead. Dates and numbers may be displayed with text-like formatting but are stored as numeric values in Sheets.
Find a word or phrase with SEARCH
SEARCH returns the position where one string begins inside another. If the phrase is absent, it returns an error. Wrapping it in ISNUMBER converts those outcomes into TRUE or FALSE, making the result easy to use in other formulas.
With the text to check in A2 and the search phrase “urgent,” use =ISNUMBER(SEARCH("urgent",TO_TEXT(A2))). If A2 contains “Please mark this urgent,” the formula returns TRUE; if it contains “Waiting for approval,” it returns FALSE. SEARCH is not case-sensitive, so “URGENT,” “Urgent,” and “urgent” all match.
TO_TEXT(A2) makes the input explicit as text. That is useful when the referenced cell may contain a number or another non-text value. If you know the cell contains ordinary text, the shorter version =ISNUMBER(SEARCH("urgent",A2)) is commonly sufficient.
To produce a readable result, with the phrase in A2, use =IF(ISNUMBER(SEARCH("urgent",TO_TEXT(A2))),"Review",""). It displays “Review” when the phrase is present and leaves the result blank otherwise. Replace the output text or blank string with the labels, numbers, or calculations your workflow requires.
Check whether a cell contains any text
If you mean “is this cell a text value?” rather than “does it contain this word?”, use ISTEXT. With the value to test in A2, =ISTEXT(A2) returns TRUE for a text value and FALSE for a number or a genuinely empty cell. A number formatted to look like text is still numeric; formatting alone does not change its underlying type.
This distinction matters in imported data. For example, an entry that looks like the number 0042 may be stored as text to preserve its leading zeroes, while 42 may be stored as a number. ISTEXT can distinguish those cases even though both may look similar on screen. Conversely, a formula that produces a text result is generally treated as text for this kind of check.
A cell containing a formula that returns an empty string is not the same as a truly empty cell. If your goal is to identify visible content, a basic check is =LEN(A2)>0, assuming the value is in A2. It returns FALSE for an empty cell and for a zero-length text result, but TRUE for spaces. To treat spaces as empty too, use =LEN(TRIM(A2))>0. TRIM removes ordinary leading, trailing, and repeated spaces; it does not remove every possible invisible character.
Use IF to label matching rows
A TRUE/FALSE result is useful for filtering or further calculation, but a label can make a sheet easier to scan. Suppose descriptions are in column A and you want a status in B. Enter this formula in B2, then fill it down: =IF(ISNUMBER(SEARCH("refund",TO_TEXT(A2))),"Refund mention","Other"). A description such as “Customer asked about a refund” returns “Refund mention.”
To check for either of two phrases, combine tests with OR. With the description in A2, use =IF(OR(ISNUMBER(SEARCH("refund",TO_TEXT(A2))),ISNUMBER(SEARCH("chargeback",TO_TEXT(A2)))),"Check payment","Other"). OR returns TRUE if at least one test succeeds. For several phrases, the formula grows, so a regular expression or a separate list of terms may be easier to maintain.
For a case-sensitive test, use FIND in place of SEARCH. With text in A2, =ISNUMBER(FIND("ID",TO_TEXT(A2))) matches uppercase “ID” but not lowercase “id.” FIND is appropriate when capitalization carries meaning, such as distinguishing a code convention. For ordinary prose searches, SEARCH is usually the more forgiving choice.
Match with COUNTIF and wildcards
COUNTIF offers a compact option when you want to match a pattern. With the cell to check in A2, =COUNTIF(A2,"*urgent*")>0 returns TRUE if the cell contains “urgent.” The asterisk is a wildcard meaning any number of characters, including none, so putting one on each side looks for the term anywhere in the value. COUNTIF matching is not case-sensitive.
To apply the test to a range, with descriptions in A2:A100, use =COUNTIF(A2:A100,"*urgent*") to count matching cells. This counts cells that match the pattern, not the number of times the word occurs within each cell. If one description says “urgent, then urgent again,” it contributes one matching cell to that count.
COUNTIF patterns also use the question mark as a wildcard for one character. If you need to search for a literal asterisk or question mark rather than use it as a wildcard, precede it with a tilde in the criterion. For complicated matching rules, SEARCH or REGEXMATCH may be clearer than building a long wildcard pattern.
Use REGEXMATCH for flexible patterns
REGEXMATCH tests text against a regular expression and returns TRUE or FALSE. It can be useful when one test needs to match several alternatives or a pattern rather than one fixed phrase. With the text in A2, =REGEXMATCH(TO_TEXT(A2),"(?i)urgent|overdue") matches either “urgent” or “overdue,” without regard to capitalization. The vertical bar means “or,” and (?i) makes the pattern case-insensitive.
Regular expressions treat some characters, such as a period, plus sign, or parentheses, as operators rather than ordinary characters. If the text you are searching for includes those characters literally, they may need to be escaped in the pattern. For a straightforward fixed phrase, SEARCH is often easier to read and less error-prone. Google Sheets regular expressions use RE2 syntax, so not every feature available in other regex engines is supported.
REGEXMATCH is also useful for a rule such as “contains one of these terms,” but remember that matching a pattern is not the same as finding a complete word. A search for “art” can also match “cart.” If whole-word boundaries matter, use a carefully constructed regular expression and test it against examples from your actual data.
Highlight matching cells automatically
To color cells based on their contents, use conditional formatting rather than adding a helper column. In Google Sheets in a web browser, select the cells to format and choose Format > Conditional formatting. In the side panel, set “Format cells if” to “Custom formula is,” enter a formula, choose a formatting style, and click “Done.”
For example, to highlight rows according to the description in column A, select the range A2:C100 and use =ISNUMBER(SEARCH("urgent",$A2)) as the custom formula. The dollar sign fixes the column at A, while the row number remains relative. As Sheets evaluates the rule for each selected row, it checks that row’s A-cell and applies the format across the selected row range.
Make the row number in the formula match the first row of the selected range. If your selection starts at row 5, use a reference such as $A5, not $A2. A mismatched starting row is a common reason a rule appears to highlight the row above or below the intended match.
Choose a formula and troubleshoot results
Use the simplest test that answers your question. SEARCH is a good default for a case-insensitive phrase inside a cell. FIND is for a case-sensitive phrase. ISTEXT checks the data type. COUNTIF is handy for wildcard patterns and counts, while REGEXMATCH is suited to more expressive patterns. Conditional formatting changes appearance; it does not change the cell’s value.
- The result is an error: SEARCH and FIND return an error when they cannot find the text. Use ISNUMBER around the search when you want TRUE/FALSE, or IFERROR when you need a specific fallback.
- The formula misses an apparent match: Check for extra spaces, punctuation, line breaks, or a different spelling. A phrase search needs the characters to occur in the same order.
- A number appears to match unexpectedly: TO_TEXT converts the displayed value to text for searching. Consider whether searching numeric identifiers is appropriate, especially if leading zeroes matter.
- The conditional format is offset: Confirm the formula’s row number matches the first row in the applied range and that the column reference is anchored as intended.
Google Sheets formulas generally use commas between function arguments in the examples here. A spreadsheet’s locale can affect separators and number formats, so if a formula is rejected, check the file’s locale settings and the syntax expected by that sheet. Google Sheets is browser-based; Excel has similar functions, but function availability, separators, and conditional-formatting dialogs can differ. Do not assume an Excel-specific menu path applies in Sheets.
Frequently Asked Questions
How do I check whether a cell contains a specific word?
With the text in A2, use =ISNUMBER(SEARCH("word",TO_TEXT(A2))). Replace “word” with the term you want to find. SEARCH is case-insensitive and checks for the text anywhere in the cell.
How do I check whether a cell contains any text at all?
Use =ISTEXT(A2) to test whether the cell’s value is text. If you instead want to know whether it has visible, non-space content, use =LEN(TRIM(A2))>0, bearing in mind that some invisible characters are not removed by TRIM.
How can I make a cell say Yes if another cell contains text?
With the text to check in A2, use =IF(ISNUMBER(SEARCH("word",TO_TEXT(A2))),"Yes","No"). Replace “word” with the phrase you want to detect, and change the output labels if needed.
How can I search without distinguishing uppercase and lowercase?
SEARCH already ignores capitalization. FIND is case-sensitive. REGEXMATCH is case-sensitive by default, but adding (?i) to the regular expression makes it case-insensitive.
Can Google Sheets highlight cells that contain a word?
Yes. Open Format > Conditional formatting, choose “Custom formula is,” and enter a rule such as =ISNUMBER(SEARCH("urgent",A2)). Adjust the cell reference to the first row of the range you are formatting.
Related
- Insert a Checked Checkbox in Word: 3 Simple Methods
- Insert a Circle Checkbox in Word: Symbols and Options
- Insert a Checkbox in Excel or Word
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Delete a Page Break in Word Without Losing Your TextTo delete a manual page break in Microsoft Word, show formatting marks, locate the line labeled Page Break,…
- Alphabetize Google Sheets: Sort Data the Right WayYes. In Google Sheets, select the data you want to organize and use Data > Sort range to…
- SUMIF Negative Numbers in Google Sheets: Syntax & ExamplesTo sum values that are negative in Google Sheets, use =SUMIF(A2:A100,"<0",B2:B100). This example checks A2:A100 for numbers below…
- How to Schedule an Email in OutlookTo schedule an email in Outlook, write your message, open the menu beside Send, and choose Schedule send…
- Advanced Excel Shortcut Keys for Faster, More Accurate WorkAdvanced Excel shortcut keys help you navigate large worksheets, edit data in batches, control formulas, and work with…
- Excel Go To Special Shortcut: How to Select Cells FastIn Excel for Microsoft 365 on Windows, press Ctrl+G or F5 to open Go To, choose Special, select…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.