Using another column as reference in conditional formatting.
-
21-12-2019 - |
Question
I want to use conditional formatting using another column as a reference. Lets lock for this example
A | B
cat.12.30.dog | cat
cow.3.cat | dog
cat.bus | truck
car.truck |
bus.dog.cat |
truck |
dog |
So I want to highlight cells in column A which begins with any word from column B therefor as a result of what I mean in the example I should get those cells highlighted
cat.12.30.dog
cat.bus
truck
dog
I have tried (=SUM) but it didn't work as I want, So I am asking for any way to do this task
Best regards
Solution
Use this formula:
=NOT(ISERROR(MATCH(1,IF(ISERROR(SEARCH($B$1:$B$3,A1)),0,SEARCH($B$1:$B$3,A1)),0)))
The result will be like this:
Make sure you do not have trailing/leading spaces.
Hope this helps.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow