How to add leading zeros?

  • Sent you a PM

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • take the quotes off the ends

    =RIGHT(TEXT(A1, "0000000"), 7)


  • I dont know how to check pm's. I dont know what the hell im missing here, this just isnt working.

    Ok, lets say cell a1 has the value 0000000000000011234

    I highlighted the cell, copied the code =RIGHT(TEXT(A1, "0000000"), 7)

    into the fx box, hit enter, and all that displays in the box now is the code. what does the "0000000" in the code do?

  • you don't want to highlight the cell with the data in it. You want a blank cell in the same row.

    In the blank cell in row 1 type

    =right(a1,7)

    this will give you the 7 right most characters in a1

    The text(a1,"0000000) was to pad the cell with 0's before you ended up doing that anyway.


  • and to check pm's there is a link at the top of the page that says

    Control Panel 0/1 Messages

    Click on Messages.


  • Thanks!! That was it, i didnt know it had to be an empty cell, and i already had the cells padded, that probably why the other one didnt work. Thanks again guys!

  • wow, so all i need the whole time was to copy this code in a empty cell =RIGHT(TEXT(A1, "0000000"), 7) and that would pad it AND pull the first seven charcaters from the right, wow. Im definetly going to be filing that knowledge.

  • Or, you can highlight the cells you want to change, right click and choose format. Select the Custom Category. Then in the Type: field, type in a zero for each digit you want, in this case 0000000. It will automatically left fill with zeros so the value is x number of characters long.

    Brian

  • bdohmen (10/4/2007)


    Or, you can highlight the cells you want to change, right click and choose format. Select the Custom Category. Then in the Type: field, type in a zero for each digit you want, in this case 0000000. It will automatically left fill with zeros so the value is x number of characters long.

    Brian

    well, that won't actually CHANGE the data in the cells, only the way it's displayed. That would/will be fine if it's just for display purposes.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg

Viewing 9 posts - 16 through 23 (of 23 total)

You must be logged in to reply to this topic. Login to reply