ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   padding ? (https://www.excelbanter.com/excel-discussion-misc-queries/75653-padding.html)

vbastarter

padding ?
 
I have a columnn with id numbers
ex:
012
456788
78
.... etc
I would like the final Id to be 10 digits so i would like to pad 0's in the
front eg:
012 - has to become 0000000012
456788 - hast to become 0000456788

Is there a function in excel that can achieve this for teh entire column ?

Many Thanks

Dave Peterson

padding ?
 
You can change the number format to "0000000000" (without the quotes) and the
cells will display all those leasing 0's.

Select the column
format|cells|number tab
custom category
type in that long string of 0's
hit ok.

vbastarter wrote:

I have a columnn with id numbers
ex:
012
456788
78
... etc
I would like the final Id to be 10 digits so i would like to pad 0's in the
front eg:
012 - has to become 0000000012
456788 - hast to become 0000456788

Is there a function in excel that can achieve this for teh entire column ?

Many Thanks


--

Dave Peterson

Gary Brown

padding ?
 

You have two options depending on what you are trying to achieve. If you
want the data to be held with the leading zeros then format the column
as text and put a data validation on the cells requesting a text length
of 10 characters.

If you are not bothered with what is actually in the cell, you just
want it to display with 10 numbers, then use a custom formt of
0000000000. This will then display the number 123 as 0000000123


--
Gary Brown
------------------------------------------------------------------------
Gary Brown's Profile: http://www.excelforum.com/member.php...o&userid=17084
View this thread: http://www.excelforum.com/showthread...hreadid=519664



All times are GMT +1. The time now is 09:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com