IF OR with Vlookup

oz67

New Member
Joined
Aug 3, 2020
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am using three conditions (highlighted in bold) in an IF OR statement below, but I am getting and #N/A. The first condition is true, the other two are false. It should still return "V3". What am I doing wrong?

=IF(OR(VLOOKUP(H4982,'Bob''s V3'!K:K,1,0)=H4982, VLOOKUP(H4982,MFG!A:A,1,0)=H4982, RIGHT(H4982,5)>="17000"),"V3","")

Thanks!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
When a VLOOKUP cannot find a matching value it will return #N/A.

So if your first VLOOKUP finds something, and the other 1 doesn't..... you have an Error in your formula (#N/A) so the whole formula cannot resolve.

To get around this, you can check does the VLOOKUP return the value TYPE you are expecting. So if the VLOOKUP returns a number, try this modifcaiton:
VBA Code:
=IF(OR(isnumber(VLOOKUP(H4982,'Bob''s V3'!K:K,1,0)=H4982), isnumber(VLOOKUP(H4982,MFG!A:A,1,0)=H4982), RIGHT(H4982,5)>="17000"),"V3","")

if it returns text, switch this for ISTEXT etc

Cheers
Caleeco
 
Upvote 0
Thanks for the reply. I tried both isnumber and istext, but I get "". The first condition is true so it should return V3.
 
Upvote 0
How about
=IF(OR(IFERROR(VLOOKUP(H4982,'Bob''s V3'!K:K,1,0),0)=H4982, IFERROR(VLOOKUP(H4982,MFG!A:A,1,0),0)=H4982, RIGHT(H4982,5)>="17000"),"V3","")
 
Upvote 0
Try this version:

=IF(OR(COUNTIF('Bob''s V3'!K:K,H4982),COUNTIF(MFG!A:A,H4982),RIGHT(H4982,5)+0>=17000),"V3","")
 
Upvote 0
I don't suppose 'Bob''s V3'! ....
...should be 'Bob's V3'! ...
...should it, by any chance?
 
Upvote 0
You need to double-up the apostrophe so Bob''s is correct.
 
Upvote 0
Guys thanks so much! Both Fluff's and Haseeb's formulas work!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,256
Messages
6,123,912
Members
449,132
Latest member
Rosie14

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