Using IF & AND and getting #NAME?

A

Amy

To determine if a date falls within a time period, I created this
function, but keep getting #NAME? for the result.

=IF(AND(7/1/2005<=AE,AE<=6/30/2006),"FY2005","NA")

This function is in AF, where the result would be placed.

I will appreciate advice what is wrong or missing with this function?

Thanks!
 
T

T. Valko

=IF(AND(7/1/2005<=AE,AE<=6/30/2006),"FY2005","NA")

The problem is that Excel can resolve what "AE" is.

I'm assuming that AE is meant to be a cell reference. Column AE but what
row?

Also, when using dates in comparison expressions it's easier to read and
understand if you either use the DATE function or enter the dates in cells
then refer to those cells. As you have it now the dates aren't being
evaluated as dates but rather as the math expression: 7 divided by 1 divided
by 2005 and 6 divided by 30 divided by 2006.

Let's assume AE means cell AE1.

So...

AE1 = some date

=IF(AND(AE1>=DATE(2005,7,1),AE<=DATE(2006,6,30)),"FY2005","NA")

Or:

A1 = 7/1/2005
B1 = 6/30/2006

=IF(AND(AE1>=A1,AE<=B1),"FY2005","NA")
 
T

T. Valko

The problem is that Excel can resolve what "AE" is.

That should be: can't

The problem is that Excel can't resolve what "AE" is.
 
T

T. Valko

For cryin out loud!

2 more typos:
=IF(AND(AE1>=DATE(2005,7,1),AE<=DATE(2006,6,30)),"FY2005","NA") =IF(AND(AE1>=DATE(2005,7,1),AE1<=DATE(2006,6,30)),"FY2005","NA")

=IF(AND(AE1>=A1,AE<=B1),"FY2005","NA")
=IF(AND(AE1>=A1,AE1<=B1),"FY2005","NA")
 
A

Amy

Thank you, Bill! That was very clear and helpful . (I caught the "can't"
early enough!)
 
Top