View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default If its a date, then...

But there are other date formats.

maybe...

=IF(LEFT(CELL("format",A4),1)="D","Y","n")

And I think I'd check for a number, too. I can type text in a cell that's
formatted as a date.

=IF(AND(ISNUMBER(A4),LEFT(CELL("format",A4),1)="D" ),"Y","n")

And to the OP, be aware that if you change the format of A4 (to General, say),
then the formula won't evaluate until the next recalculation.

VBA Noob wrote:

This formula checks to see if cell fomatted as d-mmm-yy or dd-mmm-yy

See cell help for more examples.

it will still show "Y" if it looks like a date e.g '17/06/07 will still
return "Y"

=IF(CELL("format",A4)="D1","Y","")

VBA Noob

--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=562744


--

Dave Peterson