Show blank if "x" or "X", else run a VLOOKUP

rsbidinger

New Member
Joined
May 29, 2019
Messages
8
Hello, I'm trying to put in a formula to output the cell blank if marked 'x' or 'X', else run a VLOOKUP.

How do I do this? Essentially, I'm trying to combine the following...

Here's my IF statement:
=IF(OR(H12<>"X",H12<>"x"),result,"")

Here's my VLOOKUP:
=VLOOKUP($C11,'Blue'!$C11:$O$500,7,FALSE)

Thank you for your help.

Ryan
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I assume result will be the vlookup formula?

Try:
=IF(H12="x","",VLOOKUP($C11,'Blue'!$C11:$O$500,7,FALSE))

IF is not case sensitive so x is equivalent to X.
 
Last edited:
Upvote 0
If your result is the VLOOKUP, just place that in place of "result" as:

Code:
=IF(OR(H12<>"X",H12<>"x"),VLOOKUP($C11,$C11:$O$500,7,FALSE),"")

Assuming that's what you mean.

If you want an exact match (e.g., H12 compared to an upper case X):

Code:
=IF(EXACT(H12,"X"),VLOOKUP($C11,$C11:$O$500,7,FALSE),"")
 
Last edited:
Upvote 0
Welcome to the message board!

Excel isn't too picky about letter casing so you don't have to worry about the "x" or "X" part. That being said all you have to do is combine your two formulas:

=IF(H12="x","",VLOOKUP($C12,Blue!$C11:$O$500,7,FALSE))
 
Upvote 0
Shouldn't that be AND rather than OR in the formula?
Otherwise it will always result in TRUE
 
Last edited:
Upvote 0
Thank you so much!! This worked although the VLOOKUP displays 0 instead of the text displayed on the 'Blue' source sheet. Is there a way to show the text instead of a value?
 
Upvote 0
Shouldn't that be AND rather than OR in the formula?
Otherwise it will always result in TRUE

In the specific case of "x" and "X" it can return FALSE when x (or X) is entered in the cell - as it's the same
 
Upvote 0
Thank you so much!! This worked although the VLOOKUP displays 0 instead of the text displayed on the 'Blue' source sheet. Is there a way to show the text instead of a value?

I assume this formula is being entered on a different sheet to the "Blue" sheet?
It depends on your data I suppose, hard to tell what it should return!
 
Upvote 0
Okay one more question...

It's showing zero because the VLOOKUP sees a blank cell. If it's a blank cell, is there a way to tell it to show blank instead of zero? Thanks.
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,181
Members
448,871
Latest member
hengshankouniuniu

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