Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Determine the data type of a cell

  Asked By: Lambodar    Date: Nov 21    Category: MS Office    Views: 1134
  

I want to determine, the data type of a particular cell. For eg:
A1 contains a numeric value, A2 contains a text, A3 contains a string, A4
contains a date.

I want in B1 to B4, a cell formulae, which determines, what data type is the
value in A1, A2, A3, A4 respectively.

I have the idea of determining a numeric and a text through the use of
IsNumber
and IsText functions respectively or by using =Type() function which returns 1
or 2 or 3 based on the data type in the cells. I dont know how to do it for date
type.

Can someone pls help me with that.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Daya Sharma     Answered On: Nov 21

Problem is - a date  IS a number. Any number (within reason) can be
formatted as a date. And any date can be formatted as a number.

Ask it for its format ...

=CELL("format",$A4)

if the string  returned starts with "D" then Excel believes it is a date (or
at least, that it is formatted as a date).

 
Didn't find what you were looking for? Find more on Determine the data type of a cell Or get search suggestion and latest updates.




Tagged: