r/excel•
lauran2019

Need a formula to lookup from values on a list with no set delimiters

unsolved

So here is the formula so far. First, it does not work. Second, I do not know how to fix it.

Here is the problem: I have a column in an excel table that contains a registration number. The registration number always has a prefix that permits you to know which country it is from. The prefix is not a set number of characters; it is not a set character; nor is there a set delimiter. There is a "-" in many, but not all, and the "-" is not always at the end of the prefix. For instance, N1235 is from the US, and C3-345d is from Andorra.

I'm using a helper column to locate and return the prefix and then a third column to look the prefix up in a table and return the country of origin. This formula is in the helper column.

If I group if statements, I think there would be too many. I almost need to do it backwards from normal, like excel read this entire list of prefixes and decide which one it is.

Here are some sample prefixes and their countries:

Regn PrefixCountry Name
B-HChina, Hong Kong
B-KChina, Hong Kong
B-LChina, Hong Kong
B-MChina, Macau
C2-Naura
C3-Andorra
C6-Bahamas
CXChristmas Islands
F-OReunion Island
F-ODNew Caledonia
F-OGGuadeloupe
F-OGMartinique
F-OHTahiti
HLKorea, Rep. of
JAJapan
NUnited States of America
V8-Brunei
VH-Australia
VP-BBermuda
VQ-BBermuda
VP-CCayman Islands
VP-FFalkland Islands
VP-LMA-LUZMontserrat
VP-LVBritish Virgin Islands
VQ-HSt. Helena
VQ-TTurks and Caicos Islands
XC-Mexico
XT-Burkina Faso
2-Guernsey
3X-Guinea
5H-Tanzania

Posted Mar 6, 2026, 9:48 PM UTC

210
Loading comments…