Nested IF AND

Alex501

Board Regular
Joined
Dec 11, 2015
Messages
54
Office Version
  1. 365
  2. 2019
Hi

I need a bit of help with a nested IF AND formula. I can get nested IF's to work with no problem, however if I add and into the mix it seems to go awry. The data i have is as follows;


AB
12500Yes
22500No
31200Yes
41200No
51900Yes
61900No

<tbody>
</tbody>

The equation is as follows;

IF(AND(A2>2190,B2="No","Yes",IF(AND(A2>1825,B2="Yes","Yes","No"))))

What I'm expecting is that row 1 and 2 would be 'Yes', rows 3 and 4 would be 'No', row 5 'Yes' and row 6 'No' - however I keep getting errors in the equation and can't seem to see where it's going wrong.

Thanks for any help.

Alex
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
dont use IIF, use a table, youve done half the work!

Put these values into a table and let the FUNCTiON pull the data.
the function will look it up. VLOOKUP.
 
Last edited:
Upvote 0
You have your brackets in the wrong place. You need to close your AND statements after the second condition so that the "Yes" output is in the TRUE part of the IF statement, and so on:
=IF(AND(A2>2190,B2="No"),"Yes",IF(AND(A2>1825,B2="Yes"),"Yes","No"))
 
Upvote 0
You have your brackets in the wrong place. You need to close your AND statements after the second condition so that the "Yes" output is in the TRUE part of the IF statement, and so on:
=IF(AND(A2>2190,B2="No"),"Yes",IF(AND(A2>1825,B2="Yes"),"Yes","No"))

Hi Selig

Perfect, that did the trick. Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,215,008
Messages
6,122,672
Members
449,091
Latest member
peppernaut

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