I'm trying to color tag cells according to keywords they may contain. I've searched just about everywhere, and have tried various applications of the Search and Find functions to no avail.

Imagine I have the following cells:

[You] [ggg] [123]

and I want to highlight only the cells that contain:

numbers = [0,1,2,3,4,5,6,7,8,9]

What custom formula would I use to format only the cells containing numbers? Highlighting:


This should work as well for:

[yes] [nah] [yah]
affirmativeResponses = [yes,yah,ya,yup]
highlights: yes, yah

Pseudo code:

for i in [yes,yah,ya,yup]:
    if i in cell:
        highlight(cell, green)

1 Answer 1

  • for all numbers:

    =IF(ISNUMBER(A1), 1)


  • for specific digits (2 and 3):



  • for exact words:

    =REGEXEXTRACT(A1, "yes|nah|yah")


  • for partial (containing) matches:

    =REGEXEXTRACT(A1, "yes|nah|yah")


  • 1
    Wow, great answer. Thank you for such a comprehensive answer! Apr 17, 2019 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.