+ Reply to Thread
Results 1 to 8 of 8

howto read phone numbers from country & city code

  1. #1
    Registered User
    Join Date
    09-08-2017
    Location
    Indonesia
    MS-Off Ver
    2013
    Posts
    4

    howto read phone numbers from country & city code

    I've repeatedly made changes to the formula but it still has not worked, can someone here who can help ?

    https://prnt.sc/giouqy
    https://prnt.sc/gip11e
    https://prnt.sc/gioxl2
    https://prnt.sc/giower
    https://prnt.sc/gioyet

    Thank you

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: howto read phone numbers from country & city code

    Posting image is good start. But it would be much better to post sample workbook with data and your expected result.

    Detailing what sheet contains raw data and where you want the end result.

    Upload sample workbook by going to "Go Advanced", then to Manage attachment in Additional Options.
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    09-08-2017
    Location
    Indonesia
    MS-Off Ver
    2013
    Posts
    4

    Re: howto read phone numbers from country & city code

    Quote Originally Posted by CK76 View Post
    Posting image is good start. But it would be much better to post sample workbook with data and your expected result.

    Detailing what sheet contains raw data and where you want the end result.

    Upload sample workbook by going to "Go Advanced", then to Manage attachment in Additional Options.
    Ok this is sample workbook
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: howto read phone numbers from country & city code

    c2 =VLOOKUP(LEFT(A2,4),Main!$F$1:$G$15000,2,0) and drag down.

    I could not check the result since you did not added it.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: howto read phone numbers from country & city code

    LOOKUP isn't ideal for this. As it's approximate match.

    Either use VLOOKUP as oeldere showed.

    Or INDEX,MATCH
    =INDEX(Main!$G$2:$G$13226,MATCH(LEFT(A2,4),Main!$F$2:$F$13226,0))

  6. #6
    Registered User
    Join Date
    09-08-2017
    Location
    Indonesia
    MS-Off Ver
    2013
    Posts
    4

    Re: howto read phone numbers from country & city code

    thank you i really appreciate this solution but there is problem when country & city code have 5 digits because thereis 4 - 7 digits. so the problem is "LEFT(A2,4)" when i change it to LEFT(A2,5) there is no error with 5 digits code but back again if code only 4 digits so i must change it back to "LEFT(A2,4)"
    Last edited by andrielau; 09-08-2017 at 11:32 AM.

  7. #7
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: howto read phone numbers from country & city code

    It'd help if you can give more samples that illustrate your issue.

    Giving samples for as many different patterns that could be found in your actual data.

    Without it, it's very likely that we will give you formula that satisfy only the sample provided.

    From your description, I'd guess VBA and RegEx may be faster/easier route than formula. Are you comfortable with VBA solution?

    Edit: Come to think of it, it may not be that simple even when using VBA. See link.
    https://en.wikipedia.org/wiki/Nation...ephone_numbers

    Basically, there's different phone number pattern for various countries that you need to accommodate for.
    Last edited by CK76; 09-08-2017 at 12:21 PM. Reason: See Edit:

  8. #8
    Registered User
    Join Date
    09-08-2017
    Location
    Indonesia
    MS-Off Ver
    2013
    Posts
    4

    Re: howto read phone numbers from country & city code

    thank you for all comment, i just make modification formula and it's work when i test it start from 3 until 7 country & city code and no error. i hope it's final

    =IF(ISNA(VLOOKUP(LEFT(A2,3),Main!$F$1:$G$13226,2,0)),IF(ISNA(VLOOKUP(LEFT(A2,4),Main!$F$1:$G$13226,2,0)),IF(ISNA(VLOOKUP(LEFT(A2,5),Main!$F$1:$G$13226,2,0)),IF(ISNA(VLOOKUP(LEFT(A2,6),Main!$F$1:$G$13226,2,0)),IF(ISNA(VLOOKUP(LEFT(A2,7),Main!$F$1:$G$13226,2,0)),"",VLOOKUP(LEFT(A2,7),Main!$F$1:$G$13226,2,0)),VLOOKUP(LEFT(A2,6),Main!$F$1:$G$13226,2,0)),VLOOKUP(LEFT(A2,5),Main!$F$1:$G$13226,2,0)),VLOOKUP(LEFT(A2,4),Main!$F$1:$G$13226,2,0)),VLOOKUP(LEFT(A2,3),Main!$F$1:$G$13226,2,0))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calculate distance between two address by Google map (in same city and country)
    By ronlau123 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-23-2017, 01:09 AM
  2. [SOLVED] How can I get country name based on city names in the columns
    By alipezu in forum Excel General
    Replies: 10
    Last Post: 11-29-2016, 02:50 AM
  3. [SOLVED] Proper Phone Numbers Based on Country Code
    By Mohanmoni in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-24-2014, 03:35 PM
  4. City/ State/ Country to TimeZone conversion
    By vij8y in forum Excel General
    Replies: 3
    Last Post: 09-22-2014, 02:21 AM
  5. Data Validation of Country and City
    By csunilkumar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-05-2014, 08:45 AM
  6. Replies: 4
    Last Post: 04-04-2013, 03:44 PM
  7. Inserting country code "1" into an existing column of phone numbers
    By Snowyky in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 03-18-2008, 06:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1