Elaboration/rant about data type vs. format
Formatting is a kind of preparation for data, to decide how it should be displayed. The format option “Number” does not instruct the cell to hold a number, but decides how to render numerical content. This is different from the data type definition for database cells. There is one notable similarity: If you format a cell as a text cells, it will subsequently not interpret numbers or formulas, but take what is entered as verbatim text input. However, if the cell already holds a number or a formula, formatting the cell as a text cell will not change existing content, only future input.
Those selectable formats listed in the dialog are “quick picks” which cater for most needs. You can actually have much more elaborate formatting by manual entry in the format code field. You can use up to 4 different format specifiers, the 3 first for different number ranges (default to positive/negative/zero, but this is also configurable) and the fourth for textual data (input which is explicitly given as text, or which does not have an unambiguous numerical interpretation). See the help system for details.
How to get data type
You can use the CELL()
function to find out which data type the cell holds. =CELL(<address>;"TYPE")
returns …
-
b
if the cell is empty (Blank)
-
l
if the cell holds text (Label ; this is the type also returned for an empty text string)
-
v
if the cell holds a number (Value)
The CELL()
function does not distinguish between entered data and the result of a formula. You can distinguish between those with =ISNA(FORMULA(<address>))