Forum Discussion
Help with: Finding the matching city name with the closest possible "zone code"
Hello everyone
It's my first post around here. Here's my case:
I have two companies, "company 1", "company 2"
those companies provide me with a list of city names, and a matching zone code which is basically the beginning of a phone number.
Those phone codes vary in length.
My point is to:
Read the zone code corresponding to City 1,find the closest matching zone code in Company 2 data, from the first character on the left to the last on the right. Going from left to right, if the characters stop matching... well it stops trying and bingo we have our City 2.
A picture here might explain what I'm trying to achieve:
https://imgur.com/a/JpbEnUx
The excel file is here. It's a small extract but it'll illustrate what I'm trying to automate (the result is the table on the right)
https://gofile.io/d/2UiJ1b
If you have any ideas about how to build a function to achieve that it would be greatly appreciated.
Sorry if it's not exhaustive enough, I'll try to add details, and also the excel file.
Thanks!