Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default exact length of the cell

I need to add a leading 0 if the length of the text is less than 10 char
Example: I have in A1 34126 so I need to 5 leading 0s in front
or
96750004 -so I need to add 2 leading 0s in front
What is the way to do it?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default exact length of the cell

Use a custom number format of: 0000000000

FormatCellsNumber tabCustom
Below "Type:" enter 10 zeros
OK

--
Biff
Microsoft Excel MVP


"sabi0398" wrote in message
...
I need to add a leading 0 if the length of the text is less than 10 char
Example: I have in A1 34126 so I need to 5 leading 0s in front
or
96750004 -so I need to add 2 leading 0s in front
What is the way to do it?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default exact length of the cell

Format Cells... Custom 0000000000
--
Gary''s Student - gsnu200808
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default exact length of the cell

sabi,

Note that formatting the cells will not change the actual length of the string, just how it is
displayed.

Use = TEXT(A1,"0000000000")

if you need the actual length to be 10 - copy the formula and paste down to match your data. You
can also copy those formula and paste values over the original data if that is required.

HTH,
Bernie
MS Excel MVP


"sabi0398" wrote in message
...
I need to add a leading 0 if the length of the text is less than 10 char
Example: I have in A1 34126 so I need to 5 leading 0s in front
or
96750004 -so I need to add 2 leading 0s in front
What is the way to do it?



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default exact length of the cell

in B1 put this formula

=LEFT(A1*1&TEXT(R19,"0000000000"),10)


On Oct 17, 9:56*pm, sabi0398
wrote:
I need to add a leading 0 if the length of the text is less than 10 char
Example: *I have in A1 34126 so I need to 5 leading 0s in front
or
96750004 -so I need to add 2 leading 0s in front
What is the way to do it?




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default exact length of the cell

sorry

=Text(A1,"0000000000")


On Oct 17, 10:17*pm, muddan madhu wrote:
in B1 put this formula

=LEFT(A1*1&TEXT(R19,"0000000000"),10)

On Oct 17, 9:56*pm, sabi0398
wrote:

I need to add a leading 0 if the length of the text is less than 10 char
Example: *I have in A1 34126 so I need to 5 leading 0s in front
or
96750004 -so I need to add 2 leading 0s in front
What is the way to do it?


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
Routine to find exact Row matches in Col1 Col2 Col3 but exact offsetting numbers in Col4 [email protected] Excel Discussion (Misc queries) 0 June 11th 08 11:30 PM
exact percentage of each cell lea Excel Worksheet Functions 4 April 30th 08 06:47 PM
How to paste exact value into another cell? Lewis0205NC Excel Worksheet Functions 4 January 17th 07 11:26 PM
Copy exact value from one cell to new formula in another cell asg2307 Excel Discussion (Misc queries) 2 February 6th 06 09:33 PM
Extracting an exact phrase from a Cell mazalam Excel Discussion (Misc queries) 5 September 1st 05 08:23 PM


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

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"