Adding leading zero to a number

R

RagDyeR

You could create a custom format of:

000000
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

how to add leading zeros to a number in a row, e.g 000 before 123 to make it
000123
 
R

RagDyeR

Select *one* of the rows, and then:
<Format> <Cells> <Number> tab.
Click on "Custom".
Then, in the "Type" box enter:
000000
Then hit <OK>.

*IF* the numbers in that row are then exactly as you want (need) them, copy
the format to the rest of the rows.

Select the correctly formatted row *again*.
Now, *double click* on the "FormatPainter" icon (yellow brush) on the tool
bar.
Now click on each row number that you wish to revise the format.

As you click on each row number, you should see the formats change
*immediately* to what you're looking for.

After you click on the last row, hit <Esc> to disable (turn off) the format
painter.

If you're sure of what you're doing, you could've selected *all* the rows
you want to change from the outset, and complete the format revision with
the original format change.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

How?
I have about 50 rows that need to be added "000" before the number.
 
G

Gord Dibben

Select all 50 rows.

Format>Cells>Number Tab>Custom. In the dialog box enter 000000. You will see
the results in the "Sample". OK your way out when happy.

Gord Dibben Excel MVP
 
K

Kijana

Thank you all. Somehow, through the help function in MS excel, I was able to
do it using the function that looks like this: =A2&B3
 
G

Gord Dibben

Which turns your numbers to text.

If you don't need them as numbers, that would be OK, but using a Custom Format
means no extra columns to deal with.

Gord
 
Top