#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default If Function

I am trying to add another criteria to a "IF function" that isn't working.
My current IF statement is:

IF(Or(AI3="A",And(AI3<"A",AH3<1,AL3="ZMO")),0,1)

this formula works fine but when I added AL3="USMC" to the end of the
formula it no longer returns the expected result. What do I need to add to
the formula so that it returns an answer if AL3="USMC" also. Any help is
appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default If Function

It depends on where you want it. Is it part of the OR function? Part of the
AND function? Or, is it a separate condition?

--
Biff
Microsoft Excel MVP


"Lizz45ie" wrote in message
...
I am trying to add another criteria to a "IF function" that isn't working.
My current IF statement is:

IF(Or(AI3="A",And(AI3<"A",AH3<1,AL3="ZMO")),0,1)

this formula works fine but when I added AL3="USMC" to the end of the
formula it no longer returns the expected result. What do I need to add
to
the formula so that it returns an answer if AL3="USMC" also. Any help is
appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default If Function

As AL3 can not equal both "ZMO" and "USMC" at the same time, you probably
need to insert another OR function. Also, it is redundant to check for
AI3="A", and AI3<
"A".

=IF(OR(AI3="A",AND(AH3<1,OR(AL3="USMC",AL3="ZMO") )),0,1)
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Lizz45ie" wrote:

I am trying to add another criteria to a "IF function" that isn't working.
My current IF statement is:

IF(Or(AI3="A",And(AI3<"A",AH3<1,AL3="ZMO")),0,1)

this formula works fine but when I added AL3="USMC" to the end of the
formula it no longer returns the expected result. What do I need to add to
the formula so that it returns an answer if AL3="USMC" also. Any help is
appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 236
Default If Function

tRY...
IF(Or(AI3="A",And(AI3<"A",AH3<1,AL3="ZMO"),And(A I3<"A",AH3<1,AL3="USMC")),0,1)

By just adding the AL3="USMC", you are saying 'if AL3 = ZMO and USMC.
Obviously, it can't be both at the same time.

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Lizz45ie" wrote:

I am trying to add another criteria to a "IF function" that isn't working.
My current IF statement is:

IF(Or(AI3="A",And(AI3<"A",AH3<1,AL3="ZMO")),0,1)

this formula works fine but when I added AL3="USMC" to the end of the
formula it no longer returns the expected result. What do I need to add to
the formula so that it returns an answer if AL3="USMC" also. Any help is
appreciated.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default If Function

Your question is not stated clearly enough. What exactly do you mean by
"returns an answer if AL3="USMC" also"... what does "also" apply to... the
OR or the AND part? Or is it an AND condition coupled with the OR? These are
the three possibilities as I see it. If you want it OR'ed with the other OR
conditions...

=IF(OR(AI3="A",AND(AI3<"A",AH3<1,AL3="ZMO"),AL3= "USMC"),0,1)

or if you want it AND'ed with the other AND conditions...

=IF(OR(AI3="A",AND(AI3<"A",AH3<1,AL3="ZMO",AL3=" USMC")),0,1)

or if you want it AND'ed with the OR condition...

=IF(AND(AL3="USMC",OR(AI3="A",AND(AI3<"A",AH3<1, AL3="ZMO"))),0,1)

One of these should be what you want (depending on how you meant "also" to
be interpreted).

--
Rick (MVP - Excel)


"Lizz45ie" wrote in message
...
I am trying to add another criteria to a "IF function" that isn't working.
My current IF statement is:

IF(Or(AI3="A",And(AI3<"A",AH3<1,AL3="ZMO")),0,1)

this formula works fine but when I added AL3="USMC" to the end of the
formula it no longer returns the expected result. What do I need to add
to
the formula so that it returns an answer if AL3="USMC" also. Any help is
appreciated.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default If Function

Sorry for the confusion. AL3 can equal USMC or ZMO. I want to know how do I
include the AL3="USMC" in the formula if AL3="USMC"? I tried all three of
the suggested formulas, I got #Value! error.

"Rick Rothstein" wrote:

Your question is not stated clearly enough. What exactly do you mean by
"returns an answer if AL3="USMC" also"... what does "also" apply to... the
OR or the AND part? Or is it an AND condition coupled with the OR? These are
the three possibilities as I see it. If you want it OR'ed with the other OR
conditions...

=IF(OR(AI3="A",AND(AI3<"A",AH3<1,AL3="ZMO"),AL3= "USMC"),0,1)

or if you want it AND'ed with the other AND conditions...

=IF(OR(AI3="A",AND(AI3<"A",AH3<1,AL3="ZMO",AL3=" USMC")),0,1)

or if you want it AND'ed with the OR condition...

=IF(AND(AL3="USMC",OR(AI3="A",AND(AI3<"A",AH3<1, AL3="ZMO"))),0,1)

One of these should be what you want (depending on how you meant "also" to
be interpreted).

--
Rick (MVP - Excel)


"Lizz45ie" wrote in message
...
I am trying to add another criteria to a "IF function" that isn't working.
My current IF statement is:

IF(Or(AI3="A",And(AI3<"A",AH3<1,AL3="ZMO")),0,1)

this formula works fine but when I added AL3="USMC" to the end of the
formula it no longer returns the expected result. What do I need to add
to
the formula so that it returns an answer if AL3="USMC" also. Any help is
appreciated.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default If Function

Maybe this is what you want then...

=IF(OR(AI3="A",AND(AI3<"A",AH3<1,OR(AL3="ZMO",AL 3="USMC"))),0,1)

although most would probably prefer to write it like this...

=IF(OR(AI3="A",AND(AI3<"A",AH3<1,OR(AL3={"ZMO"," USMC"}))),0,1)

--
Rick (MVP - Excel)


"Lizz45ie" wrote in message
...
Sorry for the confusion. AL3 can equal USMC or ZMO. I want to know how
do I
include the AL3="USMC" in the formula if AL3="USMC"? I tried all three of
the suggested formulas, I got #Value! error.

"Rick Rothstein" wrote:

Your question is not stated clearly enough. What exactly do you mean by
"returns an answer if AL3="USMC" also"... what does "also" apply to...
the
OR or the AND part? Or is it an AND condition coupled with the OR? These
are
the three possibilities as I see it. If you want it OR'ed with the other
OR
conditions...

=IF(OR(AI3="A",AND(AI3<"A",AH3<1,AL3="ZMO"),AL3= "USMC"),0,1)

or if you want it AND'ed with the other AND conditions...

=IF(OR(AI3="A",AND(AI3<"A",AH3<1,AL3="ZMO",AL3=" USMC")),0,1)

or if you want it AND'ed with the OR condition...

=IF(AND(AL3="USMC",OR(AI3="A",AND(AI3<"A",AH3<1, AL3="ZMO"))),0,1)

One of these should be what you want (depending on how you meant "also"
to
be interpreted).

--
Rick (MVP - Excel)


"Lizz45ie" wrote in message
...
I am trying to add another criteria to a "IF function" that isn't
working.
My current IF statement is:

IF(Or(AI3="A",And(AI3<"A",AH3<1,AL3="ZMO")),0,1)

this formula works fine but when I added AL3="USMC" to the end of the
formula it no longer returns the expected result. What do I need to
add
to
the formula so that it returns an answer if AL3="USMC" also. Any help
is
appreciated.




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
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Nested IF Function, Date Comparing, and NetworkDays Function carl Excel Worksheet Functions 2 December 29th 04 09:57 PM


All times are GMT +1. The time now is 07:01 PM.

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"