IF vlookup with multiple choices

dreximgirl

New Member
Joined
Jan 7, 2025
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I am trying to do an IF vlookup with an OR but keep hitting a wall. I have a spreadsheet with Yes No and N/A answers and I am trying to make it so that if the answer is Yes or N/A it brings back the word Compliant.

I created this =IF(OR(VLOOKUP(A3,'Audit Results '!$I:$AT,8) ="Yes", VLOOKUP(A3,'Audit Results '!$I:$AT,8) ="N/A"),"Compliant","Non-Compliant") but it brings back 'Non-Compliant' when it hits an N/A and I can't work out how to fix it

Any help would be gratefully received

Thanks

Lisa
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Welcome to the Board!

By "N/A", do you mean the "#N/A" error that is returned when it does NOT find a match?
Do you actually want it to return a "Compliant" when no match is found?
 
Upvote 0
Sorry, when I say N/A I mean that is one of the responses that has been entered in the main dataset - so in my main spreadsheet the data I have as answers to questions asked are Yes No or Not Applicable If the answer is Yes or Not Applicable then they are compliant. Does that make sense?
 
Upvote 0
Try this formula:
Excel Formula:
=LET(x,XLOOKUP(A3,'Audit Results'!$I:$I,'Audit Results'!$P:$P,""),IF(OR(x="Yes",x="N/A"),"Compliant","Non-Compliant"))
 
Upvote 0
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(OR(VLOOKUP(A3,'Audit Results '!$I:$P,8,0) ="Yes", VLOOKUP(A3,'Audit Results '!$I:$P,8,0) ="N/A"),"Compliant","Non-Compliant")
 
Upvote 0
Solution
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(OR(VLOOKUP(A3,'Audit Results '!$I:$P,8,0) ="Yes", VLOOKUP(A3,'Audit Results '!$I:$P,8,0) ="N/A"),"Compliant","Non-Compliant")
Thank you so much! This works perfectly!

You are a star xx
 
Upvote 0
Glad you got it working the way you want, but I am curious. Did my formula not work for you, or did you not try it?
 
Upvote 0
Glad you got it working the way you want, but I am curious. Did my formula not work for you, or did you not try it?
Apologies I did try yours but it just ended up putting Compliant in all of the cells even on the No's
 
Upvote 0
Apologies I did try yours but it just ended up putting Compliant in all of the cells even on the No's
That is odd - it worked for me. I tried a variety of "Yes", "No", "N/A", and other values.
It only returned "Non-Compliant" if there was a "No" or no match at all.
 
Upvote 0

Forum statistics

Threads
1,225,669
Messages
6,186,346
Members
453,349
Latest member
neam

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