IF, OR, VLOOKUP function not working with asterisk wildcard.

JEH105

New Member
Joined
Oct 11, 2019
Messages
35
Office Version
  1. 365
Platform
  1. Windows
I can't seem to figure this one out. I use this formula to search in other tables for multiple types of values. It always works like a charm, but, this year I've added two new categories "P-8" and "T-8" (the number 8 can range from 1-8, hence why i'm trying to use the asterisk) and it's not working with the asterisk. (In bold below) What am I doing wrong? :(

I'm having trouble with lines 5 and 6.

Excel Formula:
=IF(OR(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="U",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="H",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="J",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="C",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="P*",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="T*",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="B",
ISNUMBER(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0))),
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0),"Available")
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
You can't use wildcards like that, try this:
Rich (BB code):
=IF(OR(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="U",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="H",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="J",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="C",
Countif(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0),"P*"),
Countif(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0),"T*"),
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="B",
ISNUMBER(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0))),
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0),"Available")
 
Upvote 0
You can't use wildcards like that, try this:
Rich (BB code):
=IF(OR(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="U",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="H",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="J",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="C",
Countif(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0),"P*"),
Countif(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0),"T*"),
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="B",
ISNUMBER(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0))),
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0),"Available")

Ahhhh! That answers my question. I really thought I could just use the wildcard with VLOOKUP like that.

I tried the COUNTIF, but for some reason it cancels out the rest of the formula... BUT I found an alternative:

Excel Formula:
=IF(OR(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="U",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="H",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="J",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="C",
LEFT(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0),1)="P",
LEFT(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0),1)="T",
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0)="B",
ISNUMBER(VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0))),
VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0),"Available")

That did the trick! :)

Thank you for your time!
 
Upvote 0
Solution
If you wanted something a bit shorter, I think this should do the same job for you?

Excel Formula:
=LET(v,VLOOKUP(J$4,FLOW4[[#All],[Date:]:[Daniel]],2,0),IF(OR(v={"U","H","J","C","B"},OR(LEFT(v,1)={"P","T"}),ISNUMBER(v)),v,"Available"))
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

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