View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
RagDyeR RagDyeR is offline
external usenet poster
 
Posts: 3,572
Default Find text and return - NOOB question

It sound to me that you might be able to use a simple Vlookup with
wildcards, as long as you're only looking for a *single* match.

Say you have a list in Y1 to Z100, with *full* (complete) company names in
Y1 to Y100, and information pertaining to that company in Z1 to Z100.
You want to return that info from the second (Z) column.

You have an abbreviated name list in say A1 ... down to whatever.

In B1 try something like this:

=VLOOKUP("*"&A1&"*",$Y$1:$Z$100,2,0)

And copy down as needed.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"rapid1" wrote in message
...
Hi Ron

Okay, I see that and see how it works. Now, how do I search a range? As in
the previous case, (A1) is ADVAN, (B434) is ADVANTAGE but I don't know
that -
I need to search all of (B) to find (B434). Plus, there may be more than 1
occurrence of (A1).

Ray

"Ron Rosenfeld" wrote:

Ray



=SEARCH(A1,B434)

will return a 1.

Or you could do something like:

=IF(ISNUMBER(SEARCH(A1,B434)),TRUE)

which will return TRUE.

If the contents of A1 are not found in B434, then the first formula will
return
#VALUE!, the second would return FALSE.


However, if A1 is empty, or contains, for example, VAN, or TAG, or AD, or
AGE,
then the formula will also return a 1.

You could easily test for A1 being empty.

How to find the "best match" is more difficult.
--ron