Handling many conditions criteria for a VLOOKUP?

sbawnh

Board Regular
Joined
Feb 25, 2019
Messages
50
Office Version
  1. 365
Platform
  1. Windows
Hi,
If my Vlookup returns values that I don't want, I want to process them. What's an elegant way of doing this?

Vlookup(value,range,col,0) = X
IF X = "", ""
IF X = #N/A, ""
IF X = 0, ""
IF X > 0, ""
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hello,

Here is one way to do it. Just use the OR function and repeat for as many returns as you want to change to blank.

=IFERROR(IF(OR(VLOOKUP(VALUE,RANGE,COL,FALSE)="",VLOOKUP(VALUE,RANGE,COL,FALSE)="#NA",VLOOKUP(VALUE,RANGE,COL,FALSE)=0,VLOOKUP(VALUE,RANGE,COL,FALSE)>0),"",VALUE,RANGE,COL,FALSE)),"")
 
Upvote 0
Thank you. I tried to edit my post to acknowledge the repeating vlookups!
I'm hoping instead there's something neat like this.

If(vlookup(value,range,col,false)OR(=0,="",=">"",="#N/A"),"",vlookup(value,range,col,false))
 
Upvote 0
Thanks for the help. I've been searching the webs for options possibly using =Concatenate, but without a Third-party plugin, it seems there's no option.

I'll mark your response as a solution since it's correct. Thanks again.
 
Upvote 0
You can write it like
=IF(OR(VLOOKUP(L1,B2:J31,5,0)={0,1,2,3}),"",VLOOKUP(L1,B2:J31,5,0))
But as far as I'm aware you cannot use >0 or #N/A
 
Upvote 0
THANK YOU! Love the use of a dictionary. Will need to figure out what else I can stuff into it.

Is this formula any better? (Adding a lot of reading complexity for one less Vlookup)

=IF(D2="","",IFERROR(IF(OR(VLOOKUP($D2,'Worksheet'!$A:$Q,17,FALSE)={0,""}),"",VLOOKUP($D2,'Worksheet'!$A:$Q,17,FALSE)),""))

Compare

=IF(D2="","",IF(ISNA(VLOOKUP($D2,'Worksheet'!$A:$T,17,FALSE)),"",IF(VLOOKUP($D2,'Worksheet'!$A:$Q,17,FALSE)=0,"",(VLOOKUP($D2,'Worksheet'!$A:$Q,17,FALSE)))))
 
Upvote 0
This one
=IF(D2="","",IFERROR(IF(OR(VLOOKUP($D2,'Worksheet'!$A:$Q,17,FALSE)={0,""}),"",VLOOKUP($D2,'Worksheet'!$A:$Q,17,FALSE)),""))
can be simplified to
=IF(D2="","",IFERROR(IF(VLOOKUP($D2,'Worksheet'!$A:$Q,17,FALSE)=0,"",VLOOKUP($D2,'Worksheet'!$A:$Q,17,FALSE)),""))
There's no need to check if it returns "" & then make it return the same.
 
Upvote 0
Thanks!

True, that will be resolved with the IFERROR.

You da best.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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