Thursday, March 24, 2005

MS Excel : The Leading Zeros

MS Excel keeps removing that leading zero from your number?
Excel automatically sees the data as a number and leading zeros have no value in numbers, so it gets rid of them.
It is helpful when you're actually dealing with numbers, but irritating when it's a Item number or Employee number.
There is a quick way to get Excel to leave your zeros alone. Justchange the cell format to text. There are couple of ways to make this change—
1. Highlight the cells to change.
Then go to the Format menu, Cells choice. (Ctrl + 1 works too.)
On the General tab choose Text from the Categories list.
Click OK.
The leading zeros are there.
2.If you only have a few cells to change you could just type an apostrophe before entering the data (ie. instead of typing 01122 in the cell type '011122).
When you hit the Enter key the change is made instantly, for that cell only, and again your zero is there.

No comments: