+ Reply to Thread
Results 1 to 6 of 6

Telephone numbers - Remove leading zeros or replace 07 with 447

  1. #1
    Registered User
    Join Date
    04-16-2010
    Location
    lichfield
    MS-Off Ver
    Excel 2007
    Posts
    9

    Telephone numbers - Remove leading zeros or replace 07 with 447

    This might be a tricky one!

    I have a list of UK and non-UK telephone mobile numbers. The non-UK numbers start "00" and the UK numbers start "07". What I want to do is make all the numbers the same, i.e. country code and number - for example 447777555000 for UK or 353444999777 for Ireland.

    Please can someone help?

    Thanks!

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Telephone numbers - Remove leading zeros or replace 07 with 447

    Try

    =IF(LEFT(A1,2)="07","44"&RIGHT(A1,LEN(A1)-2),IF(LEFT(A1,2)="00",RIGHT(A1,LEN(A1)-2)))

    assume the number is in A1
    Martin

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Telephone numbers - Remove leading zeros or replace 07 with 447

    I would keep them with the leading zeros.

    Can you explain why you want to change them?

    Pete

  4. #4
    Registered User
    Join Date
    04-16-2010
    Location
    lichfield
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Telephone numbers - Remove leading zeros or replace 07 with 447

    I want to do a comparison with another list which has no leading zeros which is why I need to remove the zeros. So 1 list has the international telephone number (no leading zeros) and the other list has UK mobiles (starting 07) and foreign mobiles (starting 00).

  5. #5
    Registered User
    Join Date
    04-16-2010
    Location
    lichfield
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Telephone numbers - Remove leading zeros or replace 07 with 447

    Thanks, that works a treat. Is it possible to have another IF statement where if the number doesn't start with "07" or "00" to leave it as it is?
    Last edited by jkirkham; 10-12-2012 at 07:39 AM.

  6. #6
    Registered User
    Join Date
    04-16-2010
    Location
    lichfield
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Telephone numbers - Remove leading zeros or replace 07 with 447

    It's OK, I've worked it out - ended up with:

    =IF(LEFT(D2,2)="07","447"&RIGHT(D2,LEN(D2)-2),IF(LEFT(D2,2)="00",RIGHT(D2,LEN(D2)-2),(D2)))

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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