Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default If combined with OR & AND

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default If combined with OR & AND

You are comparing with text strings, not with dates. For dates, use the
DATE() function.
--
David Biddulph

"Micki" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default If combined with OR & AND

Try expressing the dates like this:

=IF(E14=--"1/31/2008"

Personally, I hate using those kinds of expressions. They're ambiguous and
cryptic. I prefer to use the DATE function like this:

=IF(E14=DATE(2008,1,31)

This can make the formula longer but there is no misunderstanding of what
I'm comparing!

Even better, use cells to hold the dates if you can:

A1 = 1/31/2008

=IF(E14=A1

--
Biff
Microsoft Excel MVP


"Micki" wrote in message
...
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.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 347
Default If combined with OR & AND

Hi,

Every AND needs an Open parenthyses and a close parenthyses, and needs to be
treated as a single condition, an example below:

IF(AND(A1=2,B1=3),"YES","NO")

You put all your closing parenthyses at the end of the formula, close your
AND's and you should be ok.

HTH
Jean-Guy

"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.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default If combined with OR & AND

Was hoping I wouldn't have to. Thanks.

"David Biddulph" wrote:

You are comparing with text strings, not with dates. For dates, use the
DATE() function.
--
David Biddulph

"Micki" wrote in message
...
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.






  #6   Report Post  
Posted to microsoft.public.excel.misc
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.

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default If combined with OR & AND

Well, between the 3 of us, myself, David and Pinmaster we "collectively"
came up with the correct answer but invidually, we all missed something!

Pinmaster got the missing ")" for the AND functions but missed the TEXT
dates. David and myself got the TEXT dates but missed the ")" for the AND
functions. So, putting it all together correctly:

=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)))


--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Try expressing the dates like this:

=IF(E14=--"1/31/2008"

Personally, I hate using those kinds of expressions. They're ambiguous and
cryptic. I prefer to use the DATE function like this:

=IF(E14=DATE(2008,1,31)

This can make the formula longer but there is no misunderstanding of what
I'm comparing!

Even better, use cells to hold the dates if you can:

A1 = 1/31/2008

=IF(E14=A1

--
Biff
Microsoft Excel MVP


"Micki" wrote in message
...
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.





  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 281
Default If combined with OR & AND


--
Farhad Hodjat


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,"")))

i think this should be the correct syntax just put what you want instead ""
that i put in your if chains.

Thanks,
"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.

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default If combined with OR & AND

I added something to my formula and now am getting a return of "FALSE". I
need the return to be zero or blank. Cell QW8 ias equal to " " when I get the
FALSE return. I tried making it a zero instead of blank, and get the same
return.

=IF(OR(A8="New
Hire",A8="Attrition",A8="Transfer",0),IF(Q8="",0), IF(E8=--"1/31/2008",0,IF(AND(E8<--"1/31/2008",E8--"1/14/2007"),L8/12,IF(AND(E8<--"1/15/2008",E8--"12/31/2007"),L8/24))))

"Farhad" wrote:


--
Farhad Hodjat


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,"")))

i think this should be the correct syntax just put what you want instead ""
that i put in your if chains.

Thanks,
"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.

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default If combined with OR & AND

Try this:

=IF(OR(A8={"New Hire","Attrition","Transfer"}),0,IF(Q8="",0,
IF(E8=--"1/31/2008",0,IF(AND(E8<--"1/31/2008",E8--"1/14/2007"),L8/12,
IF(AND(E8<--"1/15/2008",E8--"12/31/2007"),L8/24,"")))))


--
Biff
Microsoft Excel MVP


"Micki" wrote in message
...
I added something to my formula and now am getting a return of "FALSE". I
need the return to be zero or blank. Cell QW8 ias equal to " " when I get
the
FALSE return. I tried making it a zero instead of blank, and get the same
return.

=IF(OR(A8="New
Hire",A8="Attrition",A8="Transfer",0),IF(Q8="",0), IF(E8=--"1/31/2008",0,IF(AND(E8<--"1/31/2008",E8--"1/14/2007"),L8/12,IF(AND(E8<--"1/15/2008",E8--"12/31/2007"),L8/24))))

"Farhad" wrote:


--
Farhad Hodjat


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,"")))

i think this should be the correct syntax just put what you want instead
""
that i put in your if chains.

Thanks,
"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.





  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default If combined with OR & AND

Perfect! Thank you.

"T. Valko" wrote:

Try this:

=IF(OR(A8={"New Hire","Attrition","Transfer"}),0,IF(Q8="",0,
IF(E8=--"1/31/2008",0,IF(AND(E8<--"1/31/2008",E8--"1/14/2007"),L8/12,
IF(AND(E8<--"1/15/2008",E8--"12/31/2007"),L8/24,"")))))


--
Biff
Microsoft Excel MVP


"Micki" wrote in message
...
I added something to my formula and now am getting a return of "FALSE". I
need the return to be zero or blank. Cell QW8 ias equal to " " when I get
the
FALSE return. I tried making it a zero instead of blank, and get the same
return.

=IF(OR(A8="New
Hire",A8="Attrition",A8="Transfer",0),IF(Q8="",0), IF(E8=--"1/31/2008",0,IF(AND(E8<--"1/31/2008",E8--"1/14/2007"),L8/12,IF(AND(E8<--"1/15/2008",E8--"12/31/2007"),L8/24))))

"Farhad" wrote:


--
Farhad Hodjat


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,"")))

i think this should be the correct syntax just put what you want instead
""
that i put in your if chains.

Thanks,
"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.




  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default If combined with OR & AND

You're welcome!

--
Biff
Microsoft Excel MVP


"Micki" wrote in message
...
Perfect! Thank you.

"T. Valko" wrote:

Try this:

=IF(OR(A8={"New Hire","Attrition","Transfer"}),0,IF(Q8="",0,
IF(E8=--"1/31/2008",0,IF(AND(E8<--"1/31/2008",E8--"1/14/2007"),L8/12,
IF(AND(E8<--"1/15/2008",E8--"12/31/2007"),L8/24,"")))))


--
Biff
Microsoft Excel MVP


"Micki" wrote in message
...
I added something to my formula and now am getting a return of "FALSE".
I
need the return to be zero or blank. Cell QW8 ias equal to " " when I
get
the
FALSE return. I tried making it a zero instead of blank, and get the
same
return.

=IF(OR(A8="New
Hire",A8="Attrition",A8="Transfer",0),IF(Q8="",0), IF(E8=--"1/31/2008",0,IF(AND(E8<--"1/31/2008",E8--"1/14/2007"),L8/12,IF(AND(E8<--"1/15/2008",E8--"12/31/2007"),L8/24))))

"Farhad" wrote:


--
Farhad Hodjat


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,"")))

i think this should be the correct syntax just put what you want
instead
""
that i put in your if chains.

Thanks,
"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.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combined ROUNDUP Frustrated in AL Excel Worksheet Functions 5 October 9th 07 03:14 PM
Combined Statements Don Excel Discussion (Misc queries) 1 May 29th 07 11:24 PM
Sort by Last Name when name is combined Lisapbs Excel Worksheet Functions 5 April 23rd 07 07:11 PM
Combined Cells slimjam Excel Worksheet Functions 2 October 13th 06 05:30 PM
Combined IF statement... Brian Excel Worksheet Functions 6 December 10th 04 06:21 AM


All times are GMT +1. The time now is 04:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"