ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   using multiple conditions (https://www.excelbanter.com/excel-discussion-misc-queries/30642-using-multiple-conditions.html)

lschuh

using multiple conditions
 
I would like to know how to write the syntax to test for
1. age44 or 2. Seniority is 9 and by determining the answer to that
3. Arsenic exposure 4.9
4. Cadmium exposure 2.4

If 1. is true or 2. true then I need to check 3. and 4.
if 1. is true or 2. is true and 3 and 4 are false then ?
if 1 or 2 is false and 3 or 4 is false then something else

would I use and or /and condition. The way I wrote my syntax the or works
but the and does not. Any clues on how to write the syntax to check for all
4 conditions?

olasa


This is one solution:
="1 is "&PROPER(TEXT(B244,""))&". 2 is "&PROPER(TEXT(B39,""))&". 3 or
4 is "&PROPER(TEXT(AND(B44.9,B52.4),""))

The formula tests all 4 conditions, since I thought the AND/OR
conditions were not clear. I.e. If 1 or 2 is False and 3 or 4 is False
...
In case you want AND/OR conditions, I would recommend to use CHOOSE.
=CHOOSE(1+(A244)*1+(A39)*2+(AND(A44.9,A52.4))* 3,"1 is False. 2. is
False. 3 or 4 is False","1 is True. 2. is False. 3 or 4......) 7
different solutions


Hope it helped
Ola Sandström


--
olasa
------------------------------------------------------------------------
olasa's Profile: http://www.excelforum.com/member.php...o&userid=17760
View this thread: http://www.excelforum.com/showthread...hreadid=379045


Duke Carey

Maybe

=IF(OR(age44,seniority0),IF(OR(aresenic4.9,cadm ium2.4),"Exposure too
high","Exposure ok"),"Too young/low seniority")


"lschuh" wrote:

I would like to know how to write the syntax to test for
1. age44 or 2. Seniority is 9 and by determining the answer to that
3. Arsenic exposure 4.9
4. Cadmium exposure 2.4

If 1. is true or 2. true then I need to check 3. and 4.
if 1. is true or 2. is true and 3 and 4 are false then ?
if 1 or 2 is false and 3 or 4 is false then something else

would I use and or /and condition. The way I wrote my syntax the or works
but the and does not. Any clues on how to write the syntax to check for all
4 conditions?


lschuh

Part of that worked. I will paste my formula
=IF(OR($F344,$G39),IF(OR($I32.5,$K32.5,$M32.5 ,$O32.5,$Q32.5,$J35,$L35,$N35,$P35,$S35),1, 0))

This works if the condition is true. If it is not I get "false". Not the 0
or 1 I am looking for.

Not to make it too complicated I will break it down.
If the first OR comes back with true and the second OR comes back with true
then the employee gets a semi physical
If the first OR comes back false and the second OR comes back true then the
employee gets an annual physical
If the first and second OR come back false then the employee doesn't get a
physical.
If the first OR comes back true but the second OR is false then the employee
doesn't get a physical

Both of the first and second or conditions must be met to get the semi.
The first condition can be met but the second condition is not, then none.
The first condition is not met and the second is not met then none
The second condition is met and the first is not then annual.

Does that make it any clearer?



"Duke Carey" wrote:

Maybe

=IF(OR(age44,seniority0),IF(OR(aresenic4.9,cadm ium2.4),"Exposure too
high","Exposure ok"),"Too young/low seniority")


"lschuh" wrote:

I would like to know how to write the syntax to test for
1. age44 or 2. Seniority is 9 and by determining the answer to that
3. Arsenic exposure 4.9
4. Cadmium exposure 2.4

If 1. is true or 2. true then I need to check 3. and 4.
if 1. is true or 2. is true and 3 and 4 are false then ?
if 1 or 2 is false and 3 or 4 is false then something else

would I use and or /and condition. The way I wrote my syntax the or works
but the and does not. Any clues on how to write the syntax to check for all
4 conditions?


lschuh

The formula I finally got to work is as follows:
=IF(OR($F344,$G39),1,0)*IF(OR($I32.5,$K32.5,$M 32.5,$O32.5,$Q32.5,$J35,$L35,$N35,$P35,$S3 5),1,0)
thanks to all who responded.

"lschuh" wrote:

I would like to know how to write the syntax to test for
1. age44 or 2. Seniority is 9 and by determining the answer to that
3. Arsenic exposure 4.9
4. Cadmium exposure 2.4

If 1. is true or 2. true then I need to check 3. and 4.
if 1. is true or 2. is true and 3 and 4 are false then ?
if 1 or 2 is false and 3 or 4 is false then something else

would I use and or /and condition. The way I wrote my syntax the or works
but the and does not. Any clues on how to write the syntax to check for all
4 conditions?



All times are GMT +1. The time now is 06:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com