Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / April 2008

Tip: Looking for answers? Try searching our database.

Asterisk in VLOOKUP search

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Charlie - 29 Apr 2008 14:31 GMT
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
Gary''s Student - 29 Apr 2008 14:46 GMT
Lookup:
SUBSTITUTE(A1,"*","")

instead
Signature

Gary''s Student - gsnu200781

> Hi,
>
[quoted text clipped - 28 lines]
> TIA,
> Charlie
Charlie - 29 Apr 2008 15:04 GMT
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.)

> Lookup:
> SUBSTITUTE(A1,"*","")
[quoted text clipped - 33 lines]
> > TIA,
> > Charlie
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.