Here is what I need to do:

This (above) is the source data. I'm going to add the Match formula to the next blank column.

Out of the data, I need to check two fields: Column J (Country) and Column K (Weight)

So I am going to compare this data to the following table:

I have this (above) on Sheet2 of the Excel Workbook.

So, in the example:
(a) If a package is for Austria, AND it is 0.5 kg or less, then it is OK TO SHIP. Otherwise, it is NOT OK TO SHIP.
(b) If a package is for Belgium, AND it is 0.5 kg or less, then it is OK TO SHIP. Otherwise, it is NOT OK TO SHIP.
(c) If a package is for Canada, AND it is 2.26 kg or less, then it is OK TO SHIP. Otherwise, it is NOT OK TO SHIP.
(d) If a package is for Uruguay, then it is NOT OK TO SHIP (because Uruguay is not on this list).

Anyway, those are just four samples to explain what's going on here.

So long story short, I need to return the values "OK" or "NOT OK" based on the aforementioned criteria.

I know it's probably very simply for all you Excel Geeks out there :-D but my brain is frazzled at the moment. It's been a long day.

Thanks for the help!!!

Greg
LVL 1
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Excel VBA DeveloperCommented:
In cell L2, insert this formula and copy down:
=IF(K2<=IFERROR(VLOOKUP(J2,Sheet2!\$A\$2:\$B\$26,2,FALSE),0),"OK","NOT OK")

The IFERROR portion essentially returns a Max Weight of zero if the country is not found on the table in Sheet2, meaning any weight shown in column K for an invalid country would be "NOT OK".

Regards,
-Glenn

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Microsoft Excel ExpertCommented:
Microsoft Excel ExpertCommented:
if you want to use it in the J and K columns here it is =IF(OR(AND(J2="Austria",K2<=0.5),AND(J2="Belgium",K2<=0.5),AND(J2="Canada",K2<=0.5),"Ok","Not OK")
Author Commented:
Thanks! Works great!

BTW ProfessorJimJam:
I need to deal with more countries than just Austria, Belgium and Canada. Check the original questions. There was a whole list of countries. Those were just examples.

Take care guys!
Excel VBA DeveloperCommented: