If functtion for date

S

Saket

Can anyone help me with getting the formula for the following :
If D3<31-12-07 then EXPIRY
IF 30-06-08>D3<31-12-07 then NEAR EXPIRY
IF D3>30-06-08 then OK

Thanx in advance
 
M

Mike H

Not sure what your trying to do but it would be better to have your dates as
cell references but try this:-

=IF(D3<DATE(2007,12,31),"Expiry",IF(D3<DATE(2008,6,30),"Near
Expiry",IF(D3>DATE(2008,6,30),"OK","Unspecified")))

Mike
 
J

joeu2004

Can anyone help me with getting the formula for the following :
If D3<31-12-07 then EXPIRY
IF 30-06-08>D3<31-12-07 then NEAR EXPIRY
IF D3>30-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.
 
D

David Biddulph

Better to use DATE, rather than DATEVALUE, then you don't get the ambiguity
of definition.
 

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

Similar Threads

please suggest a formula 2
Find within Date Range 4
Find Period Date? 5
Variable Dates in Graph Scale 1
date range 11
Excel Chart SeriesCollection Formula 1
Expiry Date calculation 3
How to select the date? 4

Top