+ Reply to Thread
Results 1 to 3 of 3

Custom format a number list that contains a hyphen

  1. #1
    Registered User
    Join Date
    12-21-2011
    Location
    Virginia Beach, VA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Question Custom format a number list that contains a hyphen

    In my data the account field contains two sets of data formats. An 6 digit and 10 digit.

    Example:

    Please Login or Register  to view this content.
    I would like to format the list to the 10 digit format using 00-000000-00 as the format.

    How do I format the 6 digit numbers that contain a hyphen into a 10 digit format 00-000000-00 with leading zeros.
    Last edited by toxicatom; 12-22-2011 at 05:00 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How can you custom format a number list that contains a hyphen?

    toxicatom,

    Could use a helper column with this formula copied down as necessary, and then hide the original:
    =TEXT(--SUBSTITUTE(A1,"-",""),"00-000000-00")
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    12-21-2011
    Location
    Virginia Beach, VA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How can you custom format a number list that contains a hyphen?

    That will work, thank you.

+ 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