check data type in excel

  • Thread starter Thread starter Grey
  • Start date Start date
G

Grey

I have a column with number and string. if it is number, i need to do
something, while string, i need to do other.
is it possible to check the data type of one cell??

million thanks
 
One way would be to use IsText(), and/or IsNumber().
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================



I have a column with number and string. if it is number, i need to do
something, while string, i need to do other.
is it possible to check the data type of one cell??

million thanks
 
Grey said:
I have a column with number and string. if it is number, i need to do
something, while string, i need to do other.
is it possible to check the data type of one cell??

million thanks

Try

=IF(CELL("type",A1)="v","Do something if number","Do something if
string")

CELL("type",A1) returns text value corresponding to the type of data
in the cell. Returns "b" for blank if the cell is empty, "l" for label
if the cell contains a text constant, and "v" for value if the cell
contains anything else.

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top