ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to suppress leading zeros in Excel (https://www.excelbanter.com/excel-discussion-misc-queries/37151-how-suppress-leading-zeros-excel.html)

Jay

How to suppress leading zeros in Excel
 
I recieve a spreadsheet that has phone stored as a 10 digit number. I need
to parse it to end up with 3 columns; AreaCode, Exchange, Extension. I use
Text to Columns to split this. The problem I have is that leading zeros are
suppressed. For example if an extension is 0040 the leading zeros are
suppressed and it is displayed as 40. How can I make sure it is always
displayed as a 4 digit number?

Niek Otten

FormatCellsNumber tab, Custom. In the Type box, enter 0000

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Jay" wrote in message
...
I recieve a spreadsheet that has phone stored as a 10 digit number. I need
to parse it to end up with 3 columns; AreaCode, Exchange, Extension. I
use
Text to Columns to split this. The problem I have is that leading zeros
are
suppressed. For example if an extension is 0040 the leading zeros are
suppressed and it is displayed as 40. How can I make sure it is always
displayed as a 4 digit number?




Dave Peterson

Make the format of the field Text instead of General (when you do your data|Text
to columns).

Jay wrote:

I recieve a spreadsheet that has phone stored as a 10 digit number. I need
to parse it to end up with 3 columns; AreaCode, Exchange, Extension. I use
Text to Columns to split this. The problem I have is that leading zeros are
suppressed. For example if an extension is 0040 the leading zeros are
suppressed and it is displayed as 40. How can I make sure it is always
displayed as a 4 digit number?


--

Dave Peterson


All times are GMT +1. The time now is 02:23 PM.

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