If/Then Function Question

  • Thread starter Thread starter chrise
  • Start date Start date
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.
 
=If(A1>=--"2004-01-31","Y","N")

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Thanks. It works.

I keep forgetting about pesky parenthesis.

Question: What is the significance of the two dashes following the >=
signs?
 
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)
 
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.
 
Back
Top