Combine AND and OR in IF statement

eboerma

New Member
Joined
Jan 29, 2018
Messages
1
I need to combine AND and OR in Excel IF statement and I'm not able to get the formula to return the correct answer. Any help would be greatly appreciated!!

Example:
If A1 is greater than plus or minus $50,000 AND A2 is greater than plus or minus 10%

=IF(AND(OR(BG5>50000,BH5>0.1),OR(BG5<-50000,BG5<-0.1)),"Over","Under")
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
From your description then I think you are looking to test 2 overall conditions:

1. Value A is greater than 50000 OR less than -50000
2. Value B is greater then 10% OR less than -10%

If both of these conditions evaluate to true then return "Over" else return "Under". If that's the case, you're pretty close; try this instead:

=IF(AND(OR(BG5>50000,BG5<-50000),OR(BH5>0.1,BH5<-0.1)),"Over","Under")
 
Upvote 0
Hi,

I think you just have your AND/OR mixed up:

Code:
=IF(OR(AND(BG5>50000,BH5>0.1),AND(BG5<-50000,BH5<-0.1)),"Over","Under")
 
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