Excel Formula IF, AND, OR to a range???

Tenal

New Member
Joined
Sep 10, 2015
Messages
5
Hi all
I am wondering if anyone can assist with creating a formula that will come back with a 'yes' or 'no', if all conditions have been met when linked to a range of cells.
In the basic example above, I want column F to come back with a 'Yes' only if the adjoining cells B-E data can all be found in the table columns G-I. In the above example only Refs 2, 3, and 22 should come back with a Yes (orange colouring indicating condition not met).
The criteria in columns H & K are variable and will change over time so the formula would need to reference the range rather then hard coding the dates/names into the formula.
Any assistance would be appreciated. Worst case is that i can do this by creating four formulas checking they meet the criteria and then a fifth formula to check that all four original formulas have been met but i was hoping for a more elegant solution.
Many thanks
Tenal

https://www.dropbox.com/s/rkuwmzwbg1rreoh/Mr Excel Help.xlsx?dl=0
 

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.
=and(countif(h:h,b2)>0,countif(i:i,c2)>0,countif(j:j,d2)>0,countif(k:k,e2)>0)

would give a TRUE / FALSE

then add an IF

=IF ( and(countif(h:h,b2)>0,countif(i:i,c2)>0,countif(j:j,d2)>0,countif(k:k,e2)>0) , "yes", "no")
 
Last edited:
Upvote 0
Thanks etaf, the formula works which is what counts. For my own benefit and future knowledge, what is the '>0' element doing?
I tested and I think the formula still works without it but I am not 100% sure.
Many thanks
 
Upvote 0
yes it will work without it , because a number above 0 is seen as a TRUE
But I wanted to make sure that ALL are greater than zero

=countif(h:h,b2)>0

is counting the column H to see if it contains the value in B2 and counts how many times

by putting the >0
now means its got to return a TRUE or FALSE
TRUE if greater than a zero
False if a zero

it just happens that anything above zero is seen as TRUE anyway
I just like to see the formula in full

also you may have wanted say duplicates where there are 2 or more entries
in which case you would put

=countif(h:h,b2)>1

hope that clarifies , if not please do not hesitate to reply
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

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