+ Reply to Thread
Results 1 to 5 of 5

Add leading zeros to text value

Hybrid View

  1. #1
    Registered User
    Join Date
    09-13-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2008, Mac
    Posts
    9

    Add leading zeros to text value

    Hi All,

    I've got a row of values like "Schaumburg 91" and "Niles 7". I'd like to render each value in the row to have leading zeros out to the hundreds place, so I would have "Schaumburg 091" and "Niles 007."

    I've tried =TEXT(A1, "000") but to no avail.

    Any suggestions?

    Thanks!
    Last edited by conorsgaffney; 10-20-2010 at 03:19 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,038

    Re: Add leading zeros to text value

    Maybethis:

    =LEFT(A1,FIND(" ",A1&" "))&" "&TEXT(MID(A1,FIND(" ",A1&" "),3),"000")
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    09-13-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2008, Mac
    Posts
    9

    Re: Add leading zeros to text value

    Yep, that definitely gives me the number with the correct amount of leading zeros. It removes the text, however. So I'm getting "091" from "Schaumburg 91"

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,038

    Re: Add leading zeros to text value

    Are you sure? Looks good for me...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-13-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2008, Mac
    Posts
    9

    Re: Add leading zeros to text value

    I got it working now. Had to copy my stuff into a new workbook. Not sure what was happening.

    THANKS!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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