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

#### DaraMurray

##### New Member
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.

Dara

#### SQUIDD

##### Well-known Member
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

#### DaraMurray

##### New Member
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!

#### DaraMurray

##### New Member
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")))``

#### SQUIDD

##### Well-known Member
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

1,082,383
Messages
5,365,142
Members
400,825
Latest member
Sreekanth_21

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...