Thanks, that works great for my sample file and also works if the values in Nm match the values in H2:H6 exactly.
In my real data however there are partial matches - the AB, CD, EF etc. are just 2 characters of longer strings, eg. XXXXABXXXX or CDZZZZZZ.

Is it possible to make this to exclude partial matches like in my original-non-working formula?
Something like "*" & $H$3 & "*" but I can work without ranges, like for example "*AB*", "*CD*"

Because the values I have in column Nm in the real data are long and sometimes letters are missing from the entire name, but they contain certain strings for sure - eg. the string RNG or TXT somewhere in the entire name in column Nm.