View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default If functtion for date

On Dec 17, 6:22 am, Saket wrote:
Can anyone help me with getting the formula for the following :
If D3<31-12-07 then EXPIRY
IF 30-06-08D3<31-12-07 then NEAR EXPIRY
IF D330-06-08 then OK


Try:

=if(D3<datevalue("31-12-07"), "EXPIRY",
if(D3<datevalue("30-06-08"), "NEAR EXPIRY", "OK")

Note: I am assuming that DATEVALUE() conforms to your country's form
of dates (dd-mm-yy). If not, you might need to conform to DATEVALUE's
form, which is dd-mm-yy in my version. Other forms of date are also
allowed.