Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Calendar Control
 
Posts: n/a
Default How to add leading 0 to four digit number?

I have a column of Zip codes in an Excel spreadsheet. Some of the values are
4 digits in length and some are 5 digits in length. I need to have the
column in text format, but since the format was numeric the leading zero
disappears. I need a formula that determines that if the length of the value
is 4 characters than add a leading zero.
  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

One way

=TEXT(A1,"00000")

Regards,

Peo Sjoblom

"Calendar Control" wrote:

I have a column of Zip codes in an Excel spreadsheet. Some of the values are
4 digits in length and some are 5 digits in length. I need to have the
column in text format, but since the format was numeric the leading zero
disappears. I need a formula that determines that if the length of the value
is 4 characters than add a leading zero.

  #3   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

With numeric code in cell A2
=TEXT(A2,"00000")
With variable length numeric string as code in cell A2
=TEXT(VALUE(A2),"00000")

Arvi Laanemets


"Calendar Control" wrote in
message ...
I have a column of Zip codes in an Excel spreadsheet. Some of the values

are
4 digits in length and some are 5 digits in length. I need to have the
column in text format, but since the format was numeric the leading zero
disappears. I need a formula that determines that if the length of the

value
is 4 characters than add a leading zero.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
How to format a number in Indian style in Excel? Victor_alb Excel Discussion (Misc queries) 2 December 21st 04 04:21 AM
When we enter a 16 digit number (credit card) the last digit chan. ceking Excel Discussion (Misc queries) 5 December 8th 04 11:45 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM
single quote 10-digit number that has leading zeroes & then conca. lorelei739 Excel Worksheet Functions 1 November 5th 04 12:02 AM


All times are GMT +1. The time now is 11:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"