View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default IF Function with Dates

=IF(AND(A1=date(2005,7,1),B1<=date(2006,6,30)),1, 0)
or even
=--(AND(A1=date(2005,7,1),B1<=date(2006,6,30)))
or
=(A1=date(2005,7,1))*(B1<=date(2006,6,30))

The first - changes true/false to -1/0. The second - changes it 1/0.

Multiplication (true*true=1) does the same thing.

Bagia wrote:

Hello,

I hope someone can help me. I would like to create an IF function for dates
in my worksheet. I have a Start Date column and End Date column. If the
date in the Start Date and End Date falls within the Fiscal Year(06), then I
want to display a 1, otherwise a 0(zero).

A1=7/01/06 (Start Date); B1=6/30/10 (End Date)

FY06 is from 7/1/2005 to 6/30/2006

What I have in C1 is =IF(AND(A1=7/1/2005,B1<=6/30/2006),1,0)

My result for FY06 is 0, but that's not correct because the End Date is not
until 12/31/2010, so it falls within the FY06. I want this formula to do the
same for FY07, FY08, and FY09.

Can someone help?

Thanks in Advance.


--

Dave Peterson