Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 184
Default Leading zeroes formula

Hi everyone. In column B I have a list of numbers. Each number
varies in length, but no number is longer than 6 cbaracters. I need a
formula that will make each number rxactly 6 characters by attaching
leading zeroes to the FRONT if the number is less than 6 characters,
or do nothing if the number is already 6 characters. The "number" can
be converted to text.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Leading zeroes formula

Hi,

Select the cell(s) and then

Format|cells - Custom

enter a custom format of 000000 That's 6 zeroes.

Mike

"Steve" wrote:

Hi everyone. In column B I have a list of numbers. Each number
varies in length, but no number is longer than 6 cbaracters. I need a
formula that will make each number rxactly 6 characters by attaching
leading zeroes to the FRONT if the number is less than 6 characters,
or do nothing if the number is already 6 characters. The "number" can
be converted to text.

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Leading zeroes formula

=IF(LEN(A1)<6,REPT("0",6-LEN(A1))&A1,IF(LEN(A1)=6,A1,""))

HIH

On 18 Mar, 18:20, Steve wrote:
Hi everyone. *In column B I have a list of numbers. *Each number
varies in length, but no number is longer than 6 cbaracters. *I need a
formula that will make each number rxactly 6 characters by attaching
leading zeroes to the FRONT if the number is less than 6 characters,
or do nothing if the number is already 6 characters. *The "number" can
be converted to text.

Thanks!


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Leading zeroes formula

of course I meant

=IF(LEN(B1)<6,REPT("0",6-LEN(B1))&B1,IF(LEN(B1)=6,B1,""))

HIH

On 18 Mar, 19:56, Jarek Kujawa wrote:
=IF(LEN(A1)<6,REPT("0",6-LEN(A1))&A1,IF(LEN(A1)=6,A1,""))

HIH

On 18 Mar, 18:20, Steve wrote:



Hi everyone. *In column B I have a list of numbers. *Each number
varies in length, but no number is longer than 6 cbaracters. *I need a
formula that will make each number rxactly 6 characters by attaching
leading zeroes to the FRONT if the number is less than 6 characters,
or do nothing if the number is already 6 characters. *The "number" can
be converted to text.


Thanks!- Ukryj cytowany tekst -


- Pokaż cytowany tekst -


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
Leading zeroes in ZIP field KateB Excel Discussion (Misc queries) 2 December 6th 06 12:44 AM
Sorry, leading zeroes again :-(( Argghhhh Excel Discussion (Misc queries) 7 November 13th 06 10:26 PM
Leading Zeroes Melissa Excel Discussion (Misc queries) 3 October 11th 06 07:38 PM
Leading Zeroes Ken Excel Discussion (Misc queries) 1 October 7th 05 03:17 PM
CSV leading zeroes Tim_nol Excel Discussion (Misc queries) 2 December 28th 04 08:19 PM


All times are GMT +1. The time now is 05:31 AM.

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

About Us

"It's about Microsoft Excel"