Hopefully, Hans' formula will do what you want. If not... and DEFINITELY for next time, please take care to produce a REPRESENTATIVE sample sheet that reflects what you have (different length strings, different rows, matches and no matches, etc, etc).

that will make it ieaser for us to understand your problem and help you.

Please amend your profile to show your current Excel product. "mac- pages" means nothing.