Walter
Walter

Reputation: 57

Excel Conditional Formatting - match or partial match value in other cell

I want the background in cell A1 to change color if it matches or partially matches the value in cell A2 using Conditional Formatting. For me right now a full match works with =A1=$A$2. But if cell A1 has the value 1X and cell A2 has the value 1 or X it doesn't work, only if it would also be 1X. How would I fix this to also include partial matches for the values below?

These are the only allowed values in cell A1: 1, X, 2, 1X, 12, X2, 1X2

These are the only allowed values in cell A2: 1, X, 2

Upvotes: 1

Views: 640

Answers (1)

A.S.H
A.S.H

Reputation: 29332

Your conditional formatting rule for A1 is

=ISNUMBER(SEARCH($A$2,A1))

To limit the possible values in A1 to a limited set, I suggest using Data Validation.

Upvotes: 1

Related Questions