+ Reply to Thread
Results 1 to 10 of 10

Custom Cell Format for Phone numbers

  1. #1
    Registered User
    Join Date
    12-02-2009
    Location
    New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    10

    Custom Cell Format for Phone numbers

    Hi

    Using MS Excel 2003

    A single column in spreadsheet contains (and will continue to receive) phone numbers which are:
    either 9-digit: 000-000-000
    or 10-digit: 000-000-0000

    The first digit in either format is a zero, which I want always to display.

    Looking for a single Custom format, to format the entire column - which will allow either a 9 digit or a 10 digit string to be entered in any cell and always have the first 2 sets (6 digits, which start with a zero) displaying as 000-000- then allow the final set to show as either 000 or 0000

    Is this possible? I've tried all ways I can think of but can't get it to work having a single format which will accept both types of ph.numbers.

    I'd like to use the Format>Cells>Custom Format if possible - not VBA or Insert Function.

    Thanks
    Annieb
    Last edited by annieb; 11-26-2010 at 07:29 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Custom Cell Format for Phone numbers

    you state that in either case the first digit is always 0 so I wonder if the below Custom Format would work for you ?

    Please Login or Register  to view this content.
    of course the above assumes the numbers entered are numbers (which might not be the case) - eg 12345678 would be 012-345-678 and 123456789 would be 012-345-6789

  3. #3
    Registered User
    Join Date
    12-02-2009
    Location
    New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Custom Cell Format for Phone numbers

    Hi DonkeyOte
    Works like a charm! Yes, all numbers (digits) in the data. Thanks so much for your help.

    Cheers
    Annieb

  4. #4
    Registered User
    Join Date
    12-02-2009
    Location
    New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Custom Cell Format for Phone numbers

    Hi DonkeyOte
    Me again

    I've just found some of the numbers I'm having to enter, have an extra zero on the end - so:
    000-000-00000

    [already have 000-000-000 and 000-000-0000 which format perfectly now, with the code you provided]

    Is that code able to be expanded to allow fro the extra possible digit? Still keeping the leading number as a zero and having the last set comprising 5digits

    I did try working it out myself, but not getting it right......

    Thanks!
    Anne

  5. #5
    Registered User
    Join Date
    12-02-2009
    Location
    New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Custom Cell Format for Phone numbers

    Grrr, I thought I had it - but no....
    whichever way I try, I get any 2 of the required formats to display correctly - but not the 3rd...

    I don't mind if the number 000-000-00000 (5 digits in last set) has to be : 000-000-000-00, if that helps - but want to keep the other numbers dsplaying format 000-000-0000 or 000-000-000

    Hope you can help!

    Cheers
    Anne
    Last edited by annieb; 11-26-2010 at 01:37 AM.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Custom Cell Format for Phone numbers

    Quote Originally Posted by annieb
    I've just found some of the numbers I'm having to enter, have an extra zero on the end - so:
    000-000-00000

    [already have 000-000-000 and 000-000-0000 which format perfectly now, with the code you provided]

    Is that code able to be expanded to allow fro the extra possible digit?
    Add a 2nd rule:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-02-2009
    Location
    New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Custom Cell Format for Phone numbers

    Perfect, Thank you again!

    Cheers
    Annieb

  8. #8
    Registered User
    Join Date
    02-06-2013
    Location
    Nottingham
    MS-Off Ver
    Excel 365
    Posts
    61

    Re: Custom Cell Format for Phone numbers

    Hi, I appreciate that this thread may be ignored as it is old but my problem relates to this question about telephone numbers.

    The difference with mine is I need the following:

    I need telephone numbers to be entered like this
    • 0123 1234567 if area code is only 4 digits followed by 7 digits, (11 total)
    • 01234 123456 if area code is 5 digits followed by 6 numbers, (11 total)
    • and if 01234 12345 if area code is 5 digits but only followed by 5, (10 total)

    All three are possible options and I need to allow this so that when the numbers are entered like this: 01231234567 it changes to: 0123 1234567 etc.

    I've tried doing the above formula: [>999999999]0000 0000000;[>99999999]00000 000000 obviously unsuccessfully, however the first part does work.

    Please help as I am getting fed up of correcting others mistakes.


    Thank you in advance

  9. #9
    Registered User
    Join Date
    02-06-2013
    Location
    Lismore Australia
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Custom Cell Format for Phone numbers

    Hi I also have a phone number problem, only i think mine is the opposite. I have phone numbers entered in the following format 0402 0402 0402 in one spreadsheet and they seem to be a text file, I then need to vlookup into another spreadsheet which has the mobile numbers entered as numbers 40204020402??? Help it is doing my head in.

    Have tried custom formatting etc but the text ones stay as text.

    Cheers

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Custom Cell Format for Phone numbers

    deyarne,

    Welcome to the Forum.

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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