ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   vlookup & wildcards (https://www.excelbanter.com/excel-worksheet-functions/30068-vlookup-wildcards.html)

Alex

vlookup & wildcards
 
The following are columns in worksheetA:

TrkCase Order
iou9876y7
p0987ewuu


The following are column in worksheetB:

CaseNo Order
987 Apples
7ewuu Pears


In Worksheet A I need a formula (Orders column) that will look to see if any
CaseNo in WorksheetB matches the TrkCase in worksheetA and if it does, put
the cooresponding Order number from worksheetB in the Orders column in
worksheetA.

I'm using VLookup(A2,worksheetBA2:B2,2,False), which works fine if I don't
use wildcards, but how can I look for CaseNo anywhere inside TrkCase? Seems
like I should be using wildcards, but was having no luck. Thanks for your
help.

Peo Sjoblom

Yes you can use wildcard in a vlookup, but does it really matters, it will
only pick up the first occurrence of a match


=VLOOKUP("*"&D1&"*",Table,2,0)

use wildcards as an example


Regards,

Peo Sjoblom


"Alex" wrote:

The following are columns in worksheetA:

TrkCase Order
iou9876y7
p0987ewuu


The following are column in worksheetB:

CaseNo Order
987 Apples
7ewuu Pears


In Worksheet A I need a formula (Orders column) that will look to see if any
CaseNo in WorksheetB matches the TrkCase in worksheetA and if it does, put
the cooresponding Order number from worksheetB in the Orders column in
worksheetA.

I'm using VLookup(A2,worksheetBA2:B2,2,False), which works fine if I don't
use wildcards, but how can I look for CaseNo anywhere inside TrkCase? Seems
like I should be using wildcards, but was having no luck. Thanks for your
help.


Peo Sjoblom

I might add that autofilter would probably be a good fit for something like
this


Regards,

Peo Sjoblom

"Peo Sjoblom" wrote:

Yes you can use wildcard in a vlookup, but does it really matters, it will
only pick up the first occurrence of a match


=VLOOKUP("*"&D1&"*",Table,2,0)

use wildcards as an example


Regards,

Peo Sjoblom


"Alex" wrote:

The following are columns in worksheetA:

TrkCase Order
iou9876y7
p0987ewuu


The following are column in worksheetB:

CaseNo Order
987 Apples
7ewuu Pears


In Worksheet A I need a formula (Orders column) that will look to see if any
CaseNo in WorksheetB matches the TrkCase in worksheetA and if it does, put
the cooresponding Order number from worksheetB in the Orders column in
worksheetA.

I'm using VLookup(A2,worksheetBA2:B2,2,False), which works fine if I don't
use wildcards, but how can I look for CaseNo anywhere inside TrkCase? Seems
like I should be using wildcards, but was having no luck. Thanks for your
help.


Alex

This isn't working, because I think the wildcards really needs to be around
the Table (somehow). I'm really looking up to see if part of TrkCase is any
field in CaseNo.


"Peo Sjoblom" wrote:

Yes you can use wildcard in a vlookup, but does it really matters, it will
only pick up the first occurrence of a match


=VLOOKUP("*"&D1&"*",Table,2,0)

use wildcards as an example


Regards,

Peo Sjoblom


"Alex" wrote:

The following are columns in worksheetA:

TrkCase Order
iou9876y7
p0987ewuu


The following are column in worksheetB:

CaseNo Order
987 Apples
7ewuu Pears


In Worksheet A I need a formula (Orders column) that will look to see if any
CaseNo in WorksheetB matches the TrkCase in worksheetA and if it does, put
the cooresponding Order number from worksheetB in the Orders column in
worksheetA.

I'm using VLookup(A2,worksheetBA2:B2,2,False), which works fine if I don't
use wildcards, but how can I look for CaseNo anywhere inside TrkCase? Seems
like I should be using wildcards, but was having no luck. Thanks for your
help.



All times are GMT +1. The time now is 01:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com