View Single Post
  #21   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default VLOOKUP text vs number issues returning value

PS.... I wrote:
Let's be precise to minimize confusion and chasing your tail.


To be clear, when I say a cell "is" text or a number, I am referring to the
type of the __value__ (cell contents) as Excel would determine it using the
ISNUMBER and ISTEXT functions.

Specifically:

1. I am __not__ referring to the cell format.

A cell can have a numeric format (General, Number, Date, etc), but its value
is text. Conversely albeit more rare, a cell can have a Text format, but
its value is numeric. AFAIK, the latter arises only if the numeric data is
entered while the cell has a numeric format, then the format is changed to
Text. Changing the format alone usually does not change the type of the
cell value.

2. I am __not__ referring to the appearance of the cell contents.

A cell might appear to be numeric or a valid date, but Excel treats it as
text because Excel does not recognize it as numeric. This can happen for
many reasons. One common reason: there are one or more misplaced spaces
or non-breaking spaces (HTML; &nbsp), which of course are difficult to
detect with the human eye. An equally common reason: the form (syntax) of
the data entry does conform to what Excel recognizes as numeric types, which
is controlled, in part, by the Regional and Language Options control panel.

3. I am __not__ referring to what you intend the cell contents to be.

You might think 1234 is a number or text, but that says nothing about what
Excel thinks it is.

-----

Once again, the only way to determine the type of the __value__ of a cell as
Excel sees it is by using the ISNUMBER and ISTEXT functions.