Value type

S

sparx

How do I write a formula that can tell if a cell is a date or a value so
it can display the correct info - I hava 3 columns - one is text - one
is currency - one is date.
I have a cell that can pick between all 3 ( say A1 or B1 or C1 ) but it
shows the currency and date as a date style cell if its looking at the
currency value???
 
S

sparx

The IS command does not perform the function needed as there must be
another way of working it out.
 
P

Peo Sjoblom

There is no way to tell if the cell value is a date (at least not full
proof)
an excel date is a number so you can test for ISNUMBER and ISTEXT thus the
IS functions are the way to go

=IF(ISNUMBER(A1),"do this","do that")
 
D

Don Guillett

put this into a regular module>then =if(isadate(g4),1,2)

Function isadate(x)
If isdate(x) Then isadate = True
End Function
 
C

CLR

Please provide a couple of lines of sample data, the formula you use to do
the "picking" between the three columns, and the desired
results...............

Vaya con Dios,
Chuck, CABGx3
 
D

Dave Peterson

Maybe you could use something like:

How do I write a formula that can tell if a cell is a date or a value so
it can display the correct info - I hava 3 columns - one is text - one
is currency - one is date.
I have a cell that can pick between all 3 ( say A1 or B1 or C1 ) but it
shows the currency and date as a date style cell if its looking at the
currency value???
 
D

Dave Peterson

....something like...

=IF(AND(ISNUMBER(A1),LEFT(CELL("format",A1),1)="d"),"it's a date","not a date")
 
Top