Forum Discussion
Converting number to have leading zeros and punctuation mark
Not sure I follow the logic although it could be just my understanding.
If 3 is converted to '0003, then I am not sure how it will not show the ' if the answer will always have it? When would the result not have the '?
Cheers
Damien
Trying to assist a colleague with this. He said that the person that trained him on his spreadsheet showed him a way to make it come out the way we want, but he did not take notes. The other person retired over a year ago so we don't know what she had done. Essentially we are attempting to get the same result as when you physically type '0003 into the cell (which gives you 0003 with the little warning message that a number is stored as text) from an initial value of 3. Seems odd, but the apostrophe has to be there due to how the data pulls from the sheet to where it gets downloaded. And we are trying to find an easier way than manually updating 500 cells.
- Damien_RosarioMar 05, 2018Silver ContributorHi Bill
Without seeing the original file in action, I don't have any ideas on how to get your document working for you.
It may also be worth reaching out to the now retired individual to see if they are happy to remind your colleague on how that worked (professional courtesy and what not).
Sorry I don't have a better answer for you.
Best wishes with the spreadsheet.
Cheers
Damien - SergeiBaklanMar 02, 2018Diamond Contributor
Hi Bill,
Perhaps you don't need a text but number representing with leading zeroes. If so you may just apply custom format like
000#
to all your few hundred cells. The result will be like
- scottmccannaSep 29, 2020Copper Contributor
This works perfectly! However, for clarification, when creating the Custom Format, the number of 0's input into the format will be the number displayed. However, I found that if you have a six-digit number to display (e.g. 000245), the Custom Format code needs to be "000###" - including one # for each non-zero number you wish to display. Interestingly, if you only enter "000##" as the format code for your six-digit number with three leading zeros, the result will be "00245" - it will truncate the displayed number starting at the left - overwriting the desire to display three leading zeros...
- SergeiBaklanSep 29, 2020Diamond Contributor
Please check Excel custom number formats which explains how custom number format works. Lot of other info as well.