Hello all
I am new to the forum as a poster, but have read it many times!
I am trying to write a small excel based tool.
Basically I have a long list of phone numbers.
They are from all different countries. They start with the international dial code of each country.
Even within the same country, they can be different total lengths.
I also have a list of what country corresponds to what international dial code.
Sometimes the list shows one number, like US and Canada which is 1. Sometimes the list shows two numbers like 44 for UK. Sometimes for places near the US they use 1767 for Dominica for example.
But it appears the longest international dial code is four numbers like Dominica 1767 and the shortest is the US and Canada with 1.
What I would like to do it write a tool that tells me what country each number comes from, but it must start with the longest dial codes first like Dominica 1767 so it knows Dominica is 1767 (if you get what i mean!).
So if X is anything, 44XXXXXXXXX is a UK number. 1767XXXXXXX is Dominica 1XXXXXXXXXX is US as long as its not one of those other countries that starts 1.
In the longer term I would like to put a larger database of numbers in it so when I put a list of numbers in it, it spits out a better answer like 447590776132 is UK mobile number issued by o2 because 44 is UK, 7590 is o2.
So, basically it needs to look at the first four numbers and match the best one first.
I would be so grateful for your help!
Bookmarks