View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Elkar Elkar is offline
external usenet poster
 
Posts: 964
Default If combined with OR & AND

First of all, if E14 contains a date, then you can't compare it to a text
string. You'll need to use the DATE function. Second, the AND functions are
redundant, since they're only evaluated in the FALSE portion of your IF
statements.

Try this:

=IF(E14=DATE(2008,1,31),0,IF(E14DATE(2008,1,14), L14/12,IF(E14DATE(2007,12,31),L14/24)))

Note that dates in 2007 or older will return a FALSE value since you didn't
specify what to do in that event.

HTH,
Elkar


"Micki" wrote:

Cell E14 contains a date and I want certain things to happen if the date is
equal to certain criteria. I'm having problems with the syntax.
IF(E14="1/31/2008",0,if(AND(e14<"1/31/2008",e14"1/14/2007",L14/12,if(AND(e14<"1/15/2008",e14"12/31/2007",L14/24)))))

Thank you.