+ Reply to Thread
Results 1 to 5 of 5

Combine 4 columns into one with - seperators

  1. #1
    Registered User
    Join Date
    03-28-2008
    Posts
    94

    Angry Combine 4 columns into one with - seperators

    I have 4 columns with a three digit number in each. all start with 0 so they are formated as text.

    I need them to end up looking like 000-000-000-000. when I try
    Please Login or Register  to view this content.
    all of the zeros go away.

    how can I do this.

  2. #2
    Registered User
    Join Date
    03-28-2008
    Posts
    94

    Re: Combine 4 columns into one with - seperators

    ok I have them all in one cell now(still have the 4 cells, but thought that it might make it easier.

    I have tried a custom format but it wont change them.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Combine 4 columns into one with - seperators

    I think they are actually numbers formatted as 000.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Combine 4 columns into one with - seperators

    try in the format
    =TEXT(A1,"000")&"-"&TEXT(B1,"000")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

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

    Re: Combine 4 columns into one with - seperators

    If they are as you say all text then your original:

    =A2&-B2&-C2&-D2

    would coerce B2:D2 back to numbers thereby dropping leading zeroes... so perhaps you meant:

    =A2&"-"&B2&"-"&C2&"-"&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