Conditional Formatting based on if specific text is present in range of cells

Anonymous
2018-01-18T22:04:42+00:00

Using Conditional Formatting, I cannot figure out the correct formula:

I would like cell G5 to have a red fill if the word "Cookie" appears anywhere in the range A16:A23

I have tried the following formula in Conditional Formatting but it will only work for the first cell in the range (A16)

=A16:A23="Cookie"

It is important to note that cells in the range A16:A23 are drop down boxes using data validation to a list on a separate worksheet in the same workbook.  I am not sure if this is affecting the results or not, but didn't want to leave out any relevant information.  Thanks!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Ashish Mathur 100.8K Reputation points Volunteer Moderator
    2018-01-18T23:20:11+00:00

    Hi,

    The conditional formatting formula should be:

    =COUNTIF(A$16:A$23,"Cookie")>0

    Hope this helps.

    4 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2018-01-19T04:30:35+00:00

    Hello this the formula for the conditional formatting, if it finds "Cookie" within any text in any cell will return TRUE and format the cell.

    Just select the range and add a new rule with this FORMULA:

    =ISNUMBER(FIND("Cookie",$A5))

    Best regards!

    6 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2018-01-19T13:22:23+00:00

    Ashish:

    This formula would only apply the conditional formatting if the word "cookie" was in the first entry in the range.  If it was any lower in the range, the conditional formatting would not apply.  Tried it out, and no good.

    Mike

    3 people found this answer helpful.
    0 comments No comments
  4. Ashish Mathur 100.8K Reputation points Volunteer Moderator
    2018-01-19T23:36:54+00:00

    That is not correct.  It will work if Cookie is found anywhere in range A16:A23.  Please retry.

    3 people found this answer helpful.
    0 comments No comments