+ Reply to Thread
Results 1 to 5 of 5

Can't append leading zero to text field populated with number values

  1. #1
    Registered User
    Join Date
    05-04-2014
    Location
    Grapevine, TX
    MS-Off Ver
    Excel 2010
    Posts
    25

    Can't append leading zero to text field populated with number values

    I have a column with a general format that looks like this: "057828001 - WACS - Irving".

    I need to remove the latter part of the value " - WACS - Irving"

    I am doing that by using the replace all and typing in "-*"; that gives me a result of 57828001.

    I need a result of 057828001.

    How do I retain the leading zero?

  2. #2
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Can't append leading zero to text field populated with number values

    If all the numbers are 9 digits: =MID(A1,1,9)

  3. #3
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Can't append leading zero to text field populated with number values

    Or just do Data > Text to Columns > Delimited > and select Space or "-". Then just delete all columns but the one with the number in the beginning.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Can't append leading zero to text field populated with number values

    Let's pretend you have A1:

    057828001 - WACS - Irving

    Then, B1:

    =TRIM(LEFT(SUBSTITUTE(A1," ",REPT(" ",50)),50))

    Copy down as far as needed

    Then copy paste values
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  5. #5
    Registered User
    Join Date
    05-04-2014
    Location
    Grapevine, TX
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Can't append leading zero to text field populated with number values

    WOrked like a charm! Thanks.

+ 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. Count Number Of lines in text files and append values to beginning of file
    By motoxeryz125 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-27-2011, 11:14 PM
  2. Replies: 9
    Last Post: 11-25-2008, 08:51 PM
  3. Leading zeroes in a text field
    By MarlaJ in forum Excel General
    Replies: 8
    Last Post: 02-12-2007, 06:33 PM
  4. [SOLVED] How can I prefill a text field with leading 0s?
    By Sweetetc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-24-2006, 03:10 PM
  5. Replies: 1
    Last Post: 10-24-2005, 06:05 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