Sign up, and CougarBoard will remember which categories you want to view. Sign up
Mar 4, 2021
10:28:10am
David Lo Pan Playmaker
Excel question: I've got a series of prefixes and I want to highlight
cells in a column that include any of the prefixes. It looks something like this:

Column to Highlight:
A2956-XYZ
222537-3527
B2987-ABC
A8176XY

Prefixes:
B2987
22537
A9766
B3278

In this example, I want to highlight 222537-3527 and B2987-ABC because they include one of the prefixes. I'm thinking conditional formatting would be good for this, but I'm stumped on how to look at one of the values in the "Column to Search" and compare against each prefix of the entire list of prefixes.

I was doing a vlookup to search the Column to Highlight with a prefix value [vlookup(prefix+"*", column_to_highlight, ....], but this obviously only returns one cell from the column to highlight (whereas each prefix may have several hits in the column to highlight) and isn't ideal.

Any ideas? You will earn my eternal respect.
This message has been modified
Originally posted on Mar 4, 2021 at 10:28:10am
Message modified by David Lo Pan on Mar 4, 2021 at 10:28:49am
David Lo Pan
Previous username
patentattycoug
Bio page
David Lo Pan
Joined
Jul 14, 2011
Last login
Apr 25, 2024
Total posts
1,917 (6 FO)
Messages
Author
Time

Posting on CougarBoard

In order to post, you will need to either sign up or log in.