Thread: If statment
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default If statment

One way with the date in A1:

=and(a1=date(2001,1,1),a1<=date(2001,12,31)

or
=year(a1)=2001

You don't need the If's for either of these two formulas. These return true or
false by themselves.



Jason wrote:

I am trying to write and if statment to include only 2001 dates. However, I
have dates both in 2000 and 2002. I tried the writing the following statment
and excel keeps giving me an error:

=IF(Date Field=1/1/2000 AND <1/1/2002, TRUE, FALSE)

Apparently excel doesn't like the and part. How can I go about getting
around this or writing the formula with a new word or character that excel
will accept?

Thanks,

jason


--

Dave Peterson