If, and, or I've tried them all

jas64

New Member
Joined
Apr 30, 2018
Messages
9
[TABLE="width: 644"]
<tbody>[TR]
[TD]I've tried all the functions and nested functions that I'm familiar with, but can't get it right. Below is what I'm looking for.

If condition #1 is true and condition #2 is true, then do formula "A". Or If condition #1 is true and condition #3 is true, then do formula "B". Or if condition #4 is true and condition #5 is true, then do formula "C". Or if condition #4 is true and condition #6 is true, then do formula "D".

[TABLE="width: 644"]
<tbody>[TR]
[TD]=IF(AL$22=4, $BB$2="LOOSE",(2*.035*12)[/TD]
[/TR]
[TR]
[TD]- OR -[/TD]
[/TR]
[TR]
[TD]=IF($AL$22=4, $BB$2="APPLIED",(3*.035*12)[/TD]
[/TR]
[TR]
[TD]- OR -[/TD]
[/TR]
[TR]
[TD]=IF($AL$22=4, $BB$2="NONE",(2*.035*12)[/TD]
[/TR]
[TR]
[TD]- OR -[/TD]
[/TR]
[TR]
[TD]=IF(AL$22=6, $BB$2="LOOSE",(2*.2*12)[/TD]
[/TR]
[TR]
[TD]- OR -[/TD]
[/TR]
[TR]
[TD]=IF($AL$22=6, $BB$2="APPLIED",(3*.2*12)[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]=IF($AL$22=6, $BB$2="NONE",(2*.2*12)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[/TR]
[TR]
[/TR]
[TR]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
I *think* this is what you're wanting...try it out and see....

PHP:
=IF(AND($AL$22 = 4,OR($BB$2="NONE",$BB$2="LOOSE")),(2*0.035*12),IF(AND($AL$22=4,$BB$2="APPLIED"),(3*0.035*12),IF(AND($AL$22=6,OR($BB$2="NONE",$BB$2="LOOSE")),(2*0.2*12),IF(AND($AL$22=6,$BB$2="APPLIED"),(3*0.2*12),"FALSE ON ALL ACCOUNTS"))))

I left the (2*0.035*12) and other such formulas as you had them...figured you had some reason...but I can't imagine why you just don't do the math and have it return the answer. At any rate, HTH.
 
Upvote 0
[TABLE="width: 644"]
<tbody>[TR]
[TD]If condition #1 is true and condition #2 is true, then do formula "A". Or If condition #1 is true and condition #3 is true, then do formula "B". Or if condition #4 is true and condition #5 is true, then do formula "C". Or if condition #4 is true and condition #6 is true, then do formula "D".[/TD]
[/TR]
[TR]
[/TR]
[TR]
[/TR]
[TR]
[/TR]
</tbody>[/TABLE]

This would appear something like this:

Code:
=IF(AND(1,2),A,IF(AND(1,3),B,IF(AND(4,5),C,IF(AND(4,6),D,"FAIL CONDITION")

I put "Fail condition" as a placeholder for whatever you want to happen if none of the 4 conditions are satisfied. (1,2) (1,3) (4,5) (4,6)

It would read something like this in the traditional sense: (the "value_if_false" portion of IF formula are basically ElseIf's)

Code:
If 1 = True and 2 = True Then
 A
 
ElseIf 1 = True and 3 = True then
 B
 
ElseIf 4 = True and 5 = True then
 C
 
ElseIf 4 = True and 6 = True then
 D
 
Else
 "Fail Condition"
 
End If
 
Last edited:
Upvote 0
Thanks for your input. The reason I don't just do the simple math, is this is in a long string of labor calculations that have more variables than I listed. I just wanted to get this base formula to work before I went too far.
 
Upvote 0
I figured it was something like that :) .

If what I had didn't work, or if you can't adjust it on your own, just come on back...I'm happy to try again.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top