+ Reply to Thread
Results 1 to 6 of 6

Spilt the phone numbers

  1. #1
    Registered User
    Join Date
    03-31-2011
    Location
    Kolkata,India
    MS-Off Ver
    Excel 2003
    Posts
    22

    Spilt the phone numbers

    Hi All,

    I am facing a challenge. I want to remove "0" from my phone no column and add "61".

    07 3018 0215
    61393397800
    1300 222 368
    61416040804
    02 4949 7300
    03 9558 1437

    I have phone no like this. I want result when it will get "0" at the very digit it will replace and then concatenate "61". I want the result like blow...

    617 3018 0215
    61393397800
    1300 222 368
    61416040804
    612 4949 7300
    613 9558 1437

    Please help!!

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Spilt the phone numbers

    Maybe try...

    =IF(LEFT(A1)="0",SUBSTITUTE(A1,"0","61"),A1)
    HTH
    Regards, Jeff

  3. #3
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: Spilt the phone numbers

    Jeffrey, that will replace every 0 with 61.

    Instead, try
    =IF(LEFT(A15)="0",61&RIGHT(A15,LEN(A15)-1))

    This will replace just the starting 0.

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Spilt the phone numbers

    Yes thanks for the improvement, but I think you forgot to return the false part of the If statement.

    =IF(LEFT(A1)="0",61&MID(A1,2,LEN(A1)),A1)

  5. #5
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: Spilt the phone numbers

    Well, we got there in the end!

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Spilt the phone numbers

    No doubt...two heads are often better than one

+ 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