View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
frosterrj frosterrj is offline
external usenet poster
 
Posts: 6
Default Extracting text from cells

Thanks, That answer's my question!

Robert

"RichardSchollar" wrote:

Robert

Used because that's 1 more than maximum characters possible in a single
cell (2^15 -1 or 32,767). The Search returns a position number where
the string starts (assuming it finds it) - so this returned number will
always be less than 32768. The lookup will therefore match against the
next lowest number returned.

Hope this helps!

Richard

frosterrj wrote:
Biff,
thanks for the help. I used the second version with the lookup table.

Can you explain what the 32768 is for? I've never seen that used before.

Thanks,
Robert

"T. Valko" wrote:

Try this:

=LOOKUP(32768,SEARCH({"ham","turkey"},A1),{"ham"," turkey"})

If you have more than a couple of words to lookup make a list of those words
in a range of cells and then refer to that range:

J1 = ham
J2 = turkey

=LOOKUP(32768,SEARCH(J$1:J$2,A1),J$1:J$2)

Biff