Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Marie
 
Posts: n/a
Default how to display zero at the left hand of a code in a cell say 045

In a cell I need to show codes with a zero at the left, how can do this
without having to format it as text first?
  #2   Report Post  
Posted to microsoft.public.excel.misc
macropod
 
Posts: n/a
Default how to display zero at the left hand of a code in a cell say 045

Hi Marie,

Use Format|Cells|Number, choose 'Custom' and input as many 0s as required
for padding into the 'Type' box. For example, if you input:
0000
and the cell contains:
1, Excel displays 0001
123, Excel displays 0123

Cheers

--
macropod
[MVP - Microsoft Word]


"Marie" wrote in message
...
In a cell I need to show codes with a zero at the left, how can do this
without having to format it as text first?



  #3   Report Post  
Posted to microsoft.public.excel.misc
Arvi Laanemets
 
Posts: n/a
Default how to display zero at the left hand of a code in a cell say 045

Hi

1. You can format the range as Custom "00000" (the number of 0's in format
string determines the length, the number is padded to). Actually the entry
remains a number - the leading 0's are only displayed.

2. You can format the range as text before you enter any values. Now you can
enter all values with leading 0's.

3. You can start all entries with an apostrophe, like '00001 - such entries
are interpreted by Excel as text, whatever the cell real format would be.

4. You can convert numeric entries into text ones, using TEXT function, like
=TEXT(A1,"00000"). Later you can convert them to values, usung paste
special, and replace original values with them.

5. you can convert numeric entries into text ones, using concatenation and
RIGHT function, like
=RIGHT("00000" & A1,5). NB! Unlike all other solutions, when some entry
contains more numbers as the length you determined in formula, the part of
it is cut off. P.e.
=TEXT(1234,"000") returns "1234", but
=RIGHT("000" & 1234,3) returns "234"


Arvi Laanemets


"Marie" wrote in message
...
In a cell I need to show codes with a zero at the left, how can do this
without having to format it as text first?



  #4   Report Post  
Posted to microsoft.public.excel.misc
T.Reisz
 
Posts: n/a
Default how to display zero at the left hand of a code in a cell say 045

\0 will give you a leading zero but you must follow it with as many # signs
as you think you might need. It will not display unwanted zeroes. 025 will
display as 025 and not 000025.

"Marie" wrote:

In a cell I need to show codes with a zero at the left, how can do this
without having to format it as text first?

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
How to click on a cell and have the content of the cell display in a different cell [email protected] Excel Worksheet Functions 0 June 6th 06 03:05 PM
Find the cell value in excel by using vb code Michael Excel Discussion (Misc queries) 5 June 14th 05 01:24 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 07:32 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"