i need help creating a function that will extract words from a string of text

B

bradyk819

i have a very long column in Excel that has the following type of
information in each cell:

Bosch|Dish|Dishwasher|Bosch Dishwasher

I'm trying to use FIND, LEFT, LEN, RIGHT, and IF to extract the word
"Dish" from the string of text.

I have a ton of these cells and they're all different, but I only need
the word left of the first "|" mark and right of the second "|" mark.

here are a few more examples of the text in each cell

Bosch|Cooking|Oven|Double|Bosch Double Convection Oven - I only want
"Cooking"

LG|Dish|Dishwasher|LG Built-In Dishwasher - I only want "Dish"

Electrolux|Fabric Care|Washer|electrolux washing machine - I only want
"Fabric Care"

Could anyone help me?

Brady
 
S

Sandy Mann

Try:
=MID(A1,SEARCH("|",A1)+1,(SEARCH("|",A1,SEARCH("|",A1)+1))-(SEARCH("|",A1)+1))


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
I

ilia

Assuming the data is in A1, exact same thing except using FIND:

=MID(A1,FIND("|",A1,1)+1,FIND("|",A1,FIND("|",A1,1)+1)-
FIND("|",A1,1)-1)

Since case doesn't matter, you can use either one. I'm not sure which
is more efficient - if either, it wouldn't be noticeable.
 
H

Harlan Grove

(e-mail address removed) wrote...
....
I have a ton of these cells and they're all different, but I only
need the word left of the first "|" mark and right of the second
"|" mark.
....

Looks like you mean between the 1st and 2nd |s. Try

=REPLACE(LEFT(A1,FIND("|",A1,FIND("|",A1)+1)-1),1,FIND("|",A1),"")
 
H

Harlan Grove

Harlan Grove said:
=REPLACE(LEFT(A1,FIND("|",A1,FIND("|",A1)+1)-1),1,FIND("|",A1),"")

Or shorter but with hardcoded #s,

=MID(LEFT(A1,FIND("|",A1,FIND("|",A1)+1)-1),FIND("|",A1)+1,1024)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top