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
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
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
Format it as 0000 (Format>Cells>Custom)
--
HTH
Bob Phillips
(replace xxxx in the email address with gmail if mailing direct)
"dlb1228" <[email protected]> wrote in message
news:[email protected]...
> 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
You can 'display' it as four digits by selecting the data, going to
Format>Cells...>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
[email protected]HIS
"dlb1228" <[email protected]> wrote in message
news:[email protected]...
>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
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
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
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks