PC Review


Reply
Thread Tools Rate Thread

Asterisk in VLOOKUP search

 
 
Charlie
Guest
Posts: n/a
 
      29th Apr 2008
Hi,

I'm using a column of data in a VLOOKUP search. Unfortunately the actual
data can have asterisks at the end, e.g.

MyDataColumn
EBV-1003
EBV-1004*
EBV-1005

MyDataTable
EBV-1003 Valve
EBV-1003* Test Valve
EBV-1004 Valve
EBV-1004* Test Valve
EBV-1005 Valve
EBV-1005* Test Valve

ValveType = VLOOKUP(MyDataColumn, MyDataTable, 2, FALSE)

....as you can see EBV-1004* will not find the test valve, it will find the
first match because the asterisk is treated as a wildcard. I have solved the
problem using SEARCH and REPLACE to repace the "*" with "~*" as per Help. It
works fine but man oh man, the formula is complex. (Because of all the
necessary ISERRORs.)

My question is: can I tell VLOOKUP to just look it up literally (binary
search) and not use wildcards? Is there a flag to set or maybe a different
function to use? Did I miss one of the lookup functions somewhere?

TIA,
Charlie

 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      29th Apr 2008
Lookup:
SUBSTITUTE(A1,"*","")

instead
--
Gary''s Student - gsnu200781


"Charlie" wrote:

> Hi,
>
> I'm using a column of data in a VLOOKUP search. Unfortunately the actual
> data can have asterisks at the end, e.g.
>
> MyDataColumn
> EBV-1003
> EBV-1004*
> EBV-1005
>
> MyDataTable
> EBV-1003 Valve
> EBV-1003* Test Valve
> EBV-1004 Valve
> EBV-1004* Test Valve
> EBV-1005 Valve
> EBV-1005* Test Valve
>
> ValveType = VLOOKUP(MyDataColumn, MyDataTable, 2, FALSE)
>
> ...as you can see EBV-1004* will not find the test valve, it will find the
> first match because the asterisk is treated as a wildcard. I have solved the
> problem using SEARCH and REPLACE to repace the "*" with "~*" as per Help. It
> works fine but man oh man, the formula is complex. (Because of all the
> necessary ISERRORs.)
>
> My question is: can I tell VLOOKUP to just look it up literally (binary
> search) and not use wildcards? Is there a flag to set or maybe a different
> function to use? Did I miss one of the lookup functions somewhere?
>
> TIA,
> Charlie
>

 
Reply With Quote
 
Charlie
Guest
Posts: n/a
 
      29th Apr 2008
Yes, thanks, that is much simpler. I modified it to place a tilde in front
of the asterisk because I actually need to find that asterisk.

SUBSTITUTE(A1,"*","~*")

(I see the SUBSTITUTE function is binary search, not using wildcards.)


"Gary''s Student" wrote:

> Lookup:
> SUBSTITUTE(A1,"*","")
>
> instead
> --
> Gary''s Student - gsnu200781
>
>
> "Charlie" wrote:
>
> > Hi,
> >
> > I'm using a column of data in a VLOOKUP search. Unfortunately the actual
> > data can have asterisks at the end, e.g.
> >
> > MyDataColumn
> > EBV-1003
> > EBV-1004*
> > EBV-1005
> >
> > MyDataTable
> > EBV-1003 Valve
> > EBV-1003* Test Valve
> > EBV-1004 Valve
> > EBV-1004* Test Valve
> > EBV-1005 Valve
> > EBV-1005* Test Valve
> >
> > ValveType = VLOOKUP(MyDataColumn, MyDataTable, 2, FALSE)
> >
> > ...as you can see EBV-1004* will not find the test valve, it will find the
> > first match because the asterisk is treated as a wildcard. I have solved the
> > problem using SEARCH and REPLACE to repace the "*" with "~*" as per Help. It
> > works fine but man oh man, the formula is complex. (Because of all the
> > necessary ISERRORs.)
> >
> > My question is: can I tell VLOOKUP to just look it up literally (binary
> > search) and not use wildcards? Is there a flag to set or maybe a different
> > function to use? Did I miss one of the lookup functions somewhere?
> >
> > TIA,
> > Charlie
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the correct syntax to search a table for an asterisk webaddict Microsoft Access 1 22nd Feb 2010 05:19 PM
File Search using the asterisk (*) wildcard =?Utf-8?B?S29rb21vam8=?= Microsoft Word Document Management 1 25th Jan 2006 05:08 AM
How do I search for an asterisk in an Excel file--it thinks the a. =?Utf-8?B?YWNl?= Microsoft Excel Misc 3 9th Dec 2004 04:23 PM
Re: How do I search a document for an Asterisk Frank Kabel Microsoft Excel Misc 0 17th Aug 2004 10:27 PM
Search for an asterisk cindee Microsoft Excel Misc 3 6th Oct 2003 04:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:46 PM.