2

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:

123

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)
0
  • for all numbers:

    =IF(ISNUMBER(A1), 1)

    0


  • for specific digits (2 and 3):

    =REGEXEXTRACT(TO_TEXT(A1), "2|3")

    0


  • for exact words:

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

    0


  • for partial (containing) matches:

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

    0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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