-----Original Message-----
There are two fundamentally different formats in Excel: text and number.
(The other formats, such as currency, percentage, date, time, etc., are
really just different ways of displaying numbers.) The distinction between
text and number is very important, as functions such as VLOOKUP will not
work if you try to look up a text value amongst numbers or vice-versa.
A cell entry is automatically text if it contains any character other than
the digits 0 to 9 and the decimal separator ("." or "," depending on your
regional settings). Two sources of confusion enter the picture here:
1. Dates may be DISPLAYED with "/" or "-" separators, or the month in
letters; times are DISPLAYED with ":" separators; percentages are DISPLAYED
with the "%" symbol; currency is DISPLAYED with a currency symbol; numbers
may be DISPLAYED with the thousand separator "," and so on. The point is
that these characters are part of the way the number is displayed, NOT part
of the underlying value. That's why such entries can easily be reformatted
to display differently.
Type the number 37972.5 into a cell formatted as general and that's what you
see.
Format this cell as date (mm/dd/yy) and you will see 12/17/03.
Format it as time (hh:mm) and you will see 12:00.
Format as European date and am/pm time and you will see 17/12/03 12:00 PM.
Format as percent and you will see 3797250%.
These are all just different ways of DISPLAYING the same underlying value of
37972.5.
2. A number can be forced to become text, for example by formatting the cell
as text BEFORE entering the data (but not after), or preceding what is typed
in with an apostrophe. It will not look any different (except being
left-aligned rather than right-aligned in a general format cell). But it
will react as text in functions.
Now, there are two ways of getting a 'number' to display leading zeros.
The first is to format as a number that always has a certain number of
digits, e.g. 0000000000 for 10 digits. Then, if you type in 20003388 you
will see 0020003388. This is a number and so will respond in functions as a
number. Apart from how it is displayed, it is indistinguishable from
20003388.
The second way is to change it to text. Then you have to type in the leading
zeros for them to appear, and "0020003388" is quite different from
"20003388".
Clearly, therefore, you must make the same choice between these two ways for
"lookup value" and "table array"
if VLOOKUP is to work. My advice is to use numbers if you possibly can,
formatting with leading zeros if required. Use text only where necessary.
However, the choice is yours, but you must choose one and stick to it - you
cannot mix text and numbers and expect things to still work.
zero's, which I need
to it works OK. But
there this be done
without reason. Format as a
number and go into this
dialog formats the "Sample"
area
.