Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How do I make a number have leading zeros to fill width of cell?
I am trying to format existing data so that instead of being a set amount of
digits, say 2 for example, it fills out the column based on its width, say 6, with leading zeros. Example - I have 55122 in a cell that has a width of 6, and I want it to say 055122. I know that changing the cell format to text and re-entering the data would fix this problem, but I want a way to change the data without re-entering it. |
#2
|
|||
|
|||
You can use a custom format of 000000, but by width, do you mean that if the
cell is widened it gets extra leading digits? -- HTH RP (remove nothere from the email address if mailing direct) "Max_Rebo1" wrote in message ... I am trying to format existing data so that instead of being a set amount of digits, say 2 for example, it fills out the column based on its width, say 6, with leading zeros. Example - I have 55122 in a cell that has a width of 6, and I want it to say 055122. I know that changing the cell format to text and re-entering the data would fix this problem, but I want a way to change the data without re-entering it. |
#3
|
|||
|
|||
If you know that you want 6 digits, you can use a custom format of:
000000 select the column format|cells|number tab|custom category You could try this custom format, too: 0*0 If you widen the cell, you may see what looks like a gap between the leading 0 and the number you typed into the cell. But if you widen/shrink that column, you'll see that this gap disappears. Max_Rebo1 wrote: I am trying to format existing data so that instead of being a set amount of digits, say 2 for example, it fills out the column based on its width, say 6, with leading zeros. Example - I have 55122 in a cell that has a width of 6, and I want it to say 055122. I know that changing the cell format to text and re-entering the data would fix this problem, but I want a way to change the data without re-entering it. -- Dave Peterson |
#4
|
|||
|
|||
Hi,
Select the data region -- "Format" -- "Cells" -- Select "Custom" under "Category" -- Enter 000000 under "Type" -- "OK" (In fact you can see under "Sample", a preview of how the numbers will be formatted, as you are enter the 0's under "Type") Regards, B. R. Ramachandran "Max_Rebo1" wrote: I am trying to format existing data so that instead of being a set amount of digits, say 2 for example, it fills out the column based on its width, say 6, with leading zeros. Example - I have 55122 in a cell that has a width of 6, and I want it to say 055122. I know that changing the cell format to text and re-entering the data would fix this problem, but I want a way to change the data without re-entering it. |
#5
|
|||
|
|||
Thank you all, that worked great!!
"Max_Rebo1" wrote: I am trying to format existing data so that instead of being a set amount of digits, say 2 for example, it fills out the column based on its width, say 6, with leading zeros. Example - I have 55122 in a cell that has a width of 6, and I want it to say 055122. I know that changing the cell format to text and re-entering the data would fix this problem, but I want a way to change the data without re-entering it. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Leading Zeros with a twist. | Excel Discussion (Misc queries) | |||
How do I force leading zeros in an Excel cell? | Excel Discussion (Misc queries) | |||
Leading zeros | Excel Discussion (Misc queries) | |||
Lookup returns #NA when search value (text) has leading zeros. | Excel Worksheet Functions | |||
Insert Leading Zeros | Excel Worksheet Functions |