Stringing together / nesting a series of IF and AND and OR functions / formulas

DaraMurray

New Member
Joined
Feb 6, 2017
Messages
14
Hi there,

I am trying to create a new column in my dataset that will display a "yes" if ANY of the three criteria are met and a "no" if none of the criteria are met. For example if someone participated in year 1 and scored a 2 or above OR participated in year 2 and scored a 2.5 or above OR participated in year 3 and scored a 3 or above I want the cell to read "Yes" because that person met the benchmark. They only need to meet one to display "Yes" not all three. If they meet none it should display "No" because they didn't meet the benchmark for their year.

Here is the last iteration of what I've tried:

Code:
=IF(AND(B2="Year 1", M2>=2),1,0,IF(AND(B2="year 2", M2>=2.5),1,0,IF(and(B2="Year 3", M2>=3.0),"Yes","No")))

This particular formula gives me an error for "you've entered too many arguments for this function".

In the beginning I got a bit closer by adding the OR function to the mix, but it returned the incorrect value (it returned "no" when it should have been "yes"). It was something like this, though this is giving me an error as well now:

Code:
=IF(OR(AND(B2="Year 1", M2>=2),AND(B2="year 2", M2>=2.5),AND(B2="Year 3", M2>=3.0),"Yes","No"))

I feel like I'm close, but it's so hard to search for help about "if" because it's such a common word.

Thanks in advance for your help!

Dara
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi Dara

I think you were close mate.
Does this work for you?

=IF(AND(B2="Year 1",M2>=2),"yes",IF(AND(B2="Year 2",M2>=2.5),"yes",IF(AND(B2="Year 3",M2>=3),"yes","no")))

Dave
 
Upvote 0
Yes!! Thank you so much! I was getting so frustrated because I could tell I was close, but just couldn't get it. :) Thanks again!
 
Upvote 0
Dave,

Do you think it would be possible to do something like this as well? And check the score against two different cells?

Code:
=IF(AND(B2="Year 1",M2>=2)OR(B2="Year 1",V2>=2),"Yes",IF(AND(B2="Year 2",M2>=2.5)OR(B2="Year 2",V2>=2.5),"Yes",IF(AND(B2="Year 3",M2>=3)OR(B2="Year 3",V2>=3)"Yes","No")))
 
Upvote 0
Hi Dara

maybe a shorter way to write this, but this should work for you.

Code:
=IF(AND(B2="year 1",M2>=2),"yes",IF(AND(B2="year 1",V2>=2),"yes",IF(AND(B2="year 2",M2>=2.5),"yes",IF(AND(B2="year 2",V2>=2.5),"yes",IF(AND(B2="year 3",M2>=3),"yes",IF(AND(B2="year 3",V2>=3),"yes","no"))))))

Dave
 
Upvote 0

Forum statistics

Threads
1,214,624
Messages
6,120,591
Members
448,973
Latest member
ksonnia

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