ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Leading 0s and Col Formatting (https://www.excelbanter.com/excel-programming/328414-leading-0s-col-formatting.html)

Brent E

Leading 0s and Col Formatting
 
I've got an Excel workbook that contains many license numbers and I need to
format the column so that if a license number has several 0s in front, they
aren't automatically truncated by Excel. I tried general, number, and text
formats but they truncate leading 0s. Any ideas? Thanks.

Jim Thomlinson[_3_]

Leading 0s and Col Formatting
 
A couple of possible solutions... As a formula
=text(A1, "00000000")
which will convert the number to text and ensure that there are 8 digit
which would include leading zeros

Format Cell - Custom - 00000000

Which will change how the number is displayed. It is still stored as a
number without leading zeros, but it is displayed with the leading zeros.

HTH

"Brent E" wrote:

I've got an Excel workbook that contains many license numbers and I need to
format the column so that if a license number has several 0s in front, they
aren't automatically truncated by Excel. I tried general, number, and text
formats but they truncate leading 0s. Any ideas? Thanks.


Chip Pearson

Leading 0s and Col Formatting
 
Use a custom number format of 000000.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Brent E" wrote in message
...
I've got an Excel workbook that contains many license numbers
and I need to
format the column so that if a license number has several 0s in
front, they
aren't automatically truncated by Excel. I tried general,
number, and text
formats but they truncate leading 0s. Any ideas? Thanks.





All times are GMT +1. The time now is 11:56 AM.

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