Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
dlb1228
 
Posts: n/a
Default put 0 in front of number

i have a field that has a number in it for example
100
115
116
12

i want these to always be 4 digits and put zeros in front of the number
how can i do this
  #2   Report Post  
Posted to microsoft.public.excel.misc
T Kirtley
 
Posts: n/a
Default put 0 in front of number

You can use a formula like =TEXT(A4,"0000") to force padded zeros to show, or
you can make a custom number format like 0000 to make up to 4 leading zeros
show, (but the actual data will not be changed)

Hope that helps,

TK

"dlb1228" wrote:

i have a field that has a number in it for example
100
115
116
12

i want these to always be 4 digits and put zeros in front of the number
how can i do this

  #3   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default put 0 in front of number

Format it as 0000 (FormatCellsCustom)

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"dlb1228" wrote in message
...
i have a field that has a number in it for example
100
115
116
12

i want these to always be 4 digits and put zeros in front of the number
how can i do this



  #4   Report Post  
Posted to microsoft.public.excel.misc
Nick Hodge
 
Posts: n/a
Default put 0 in front of number

You can 'display' it as four digits by selecting the data, going to
FormatCells...Custom and type 0000 in the text box

I stress display...the underlying data is still a number without leading
zeroes

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"dlb1228" wrote in message
...
i have a field that has a number in it for example
100
115
116
12

i want these to always be 4 digits and put zeros in front of the number
how can i do this



  #5   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default put 0 in front of number

Format as "0000"

"dlb1228" wrote:

i have a field that has a number in it for example
100
115
116
12

i want these to always be 4 digits and put zeros in front of the number
how can i do this



  #6   Report Post  
Posted to microsoft.public.excel.misc
Marcelo
 
Posts: n/a
Default put 0 in front of number

Hi

=rept("0",4-len(a2))&a2


assuming that the 100 are in A2, please, have notice that the numbers will
be a text.

Hope this helps
Regards from Brazil - going to the 6th
Marcelo


"dlb1228" escreveu:

i have a field that has a number in it for example
100
115
116
12

i want these to always be 4 digits and put zeros in front of the number
how can i do this

  #7   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default put 0 in front of number

You can preformat the cells as Text first and type all 4 digits.

You can prefix the entry with an apostrophe: '0012

Or you can give the column a custom format of: 0000
(Format|Cells|number tab|custom category and type 0000 in that box)

The value won't change, but you'll see leading zeros in the cell (not in the
formula bar, though).

dlb1228 wrote:

i have a field that has a number in it for example
100
115
116
12

i want these to always be 4 digits and put zeros in front of the number
how can i do this


--

Dave Peterson
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
Number of labels on X-axis one more than number of values on Y-axi Gudrun Charts and Charting in Excel 5 August 26th 05 01:55 PM
how to add a letter in front of each number in a cell nmodafferi Excel Discussion (Misc queries) 15 June 16th 05 08:58 PM
Count Number of Characters in a cell? AHJuncti Excel Discussion (Misc queries) 2 June 16th 05 07:39 PM
Need number of Saturdays and number of Sundays between 2 dates Class316 Excel Worksheet Functions 1 June 10th 05 02:47 AM
how do i get excel to NOT take zero's of the front of a number tor Excel Discussion (Misc queries) 2 February 16th 05 04:35 AM


All times are GMT +1. The time now is 07:00 AM.

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"