+ Reply to Thread
Results 1 to 5 of 5

Combine numeric text and retaining leading zeroes

  1. #1
    Registered User
    Join Date
    09-23-2008
    Location
    Kansas
    Posts
    32

    Combine numeric text and retaining leading zeroes

    I have 3 columns of data that I need to combine, but I need to retain leading zeroes to make the end result correct. As an example

    5 01 101
    5 10 102
    5 04 047

    I need to have the values 501101, 510102 & 504047 returned and not 51101, 510102, 5447.

    Could anyone help me with this. I was thinking a formula would be easiest, but I haven't been able to find anything to help me.

  2. #2
    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 numeric text and retaining leading zeroes

    Row\Col
    A
    B
    C
    D
    E
    1
    5
    1
    101
    501101 D1: =A1 & TEXT(B1, "00") & TEXT(C1, "000")
    2
    5
    10
    102
    510102
    3
    5
    4
    47
    504047
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Combine numeric text and retaining leading zeroes

    Format the cells as text and the leading zeros will be retained. You can also lead the cell value with ' and the contents will be text.
    A
    B
    C
    D
    1
    5 01 101 501101
    2
    5
    10
    101
    510101
    3
    5
    04 047 504047


    Top row was formatted as text, the middle row was left as General, and the bottom row used ' for cells with leading 0.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  4. #4
    Registered User
    Join Date
    09-23-2008
    Location
    Kansas
    Posts
    32

    Re: Combine numeric text and retaining leading zeroes

    much appreciated.

  5. #5
    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 numeric text and retaining leading zeroes

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 6
    Last Post: 10-09-2014, 03:05 AM
  2. Replies: 5
    Last Post: 10-10-2012, 06:04 AM
  3. Add zeroes within dates (NOT leading zeroes)
    By anthony19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2012, 04:08 PM
  4. Leading Zeroes & XML
    By jlhart76 in forum Excel General
    Replies: 4
    Last Post: 06-03-2009, 08:23 PM
  5. Retaining leading zeros in text cell problem
    By PaulC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-27-2007, 05:42 AM
  6. Leading zeroes in a text field
    By MarlaJ in forum Excel General
    Replies: 8
    Last Post: 02-12-2007, 06:33 PM
  7. Leading zeroes get dropped when converted to text
    By Jason Grunert in forum Excel General
    Replies: 8
    Last Post: 08-04-2006, 04:45 PM

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