If/Then Function Question

C

chrise

I need the formula to recognize that what it is looking at is a date
not a calculation. For example:

Column A is a date in the form of 1/31/2004
Column B is the If/Then function in the form of If A1>=1/31/2004, then
Y value if false N.

The computer is calculating 1/31/2004 and not recognizing that it is a
date. How can I make the If/Then formula recognize column A as a date
and not a calculation? I have already went down column A and verified
with Excel that the cells are in date format.

Thanks for your help.
 
B

Bob Phillips

=If(A1>=--"2004-01-31","Y","N")

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
C

chrise

Thanks. It works.

I keep forgetting about pesky parenthesis.

Question: What is the significance of the two dashes following the >=
signs?
 
B

Bob Phillips

That is to coerce the text string into a number. I like to use that date
format as it seems to work with all international settings.

You could also use =If(A1>=DATEVALUE("2004-01-31"),"Y","N"), the -- is just
a bit more efficient.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
D

Dave Peterson

Another way that may be less ambiguous:

=If(A1>=DATE(2004,1,31),"Y","N")

It always scares me with all the date formats that are available.
 

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

Top