How to extract multiple words in middle of the cell

AlaaJ

New Member
Joined
Jun 21, 2019
Messages
4
Hi

I facing an issue in extract words between some specific word
for example:

I am studying in <start:loc> London <end> but I live with my mother in <start:loc> Manchester <end> and in vacation I go to <start:loc> Cardiff <end>

I want to extract the word between tags <start:loc> <end> in one cell

I tried Mid, right, left, VBA but did not work I got London but I cannot get the rest.
Please could you help to extract words in this way London; Manchester;Cardiff
 
Last edited by a moderator:

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Re: How to extract multiple words in meddle of the cell

Hi,

What do you mean by "between tags"? I see no "tags" in that sentence.

If there are no physical delimiters present around the desired extractions, can you clarify the logic that determines which words are to be extracted? One would hope that it would be a bit less vague than, for example, "Extract all towns/cities within the sentence", which would be nigh on impossible.

Regards
 
Upvote 0
Re: How to extract multiple words in meddle of the cell

Hi,

What do you mean by "between tags"? I see no "tags" in that sentence.

If there are no physical delimiters present around the desired extractions, can you clarify the logic that determines which words are to be extracted? One would hope that it would be a bit less vague than, for example, "Extract all towns/cities within the sentence", which would be nigh on impossible.

Regards
I mean by tags (<START:LOC><END>)so I would take words in between. Is not necessary to be city
I used this formula
=MID(B2,FIND("<START:LOC>",B2)+1,FIND("<END>",B2)-FIND("<START:LOC>",B2)-1)
 
Upvote 0
Re: How to extract multiple words in meddle of the cell

The board software interpreted the tags as HTML & removed them, I have edited the op to show the tags.


@AlaaJ
When posting anything that contains either < or > symbols you need to add spaces either side.
 
Last edited:
Upvote 0
Re: How to extract multiple words in meddle of the cell

The board software interpreted the tags as HTML & removed them, I have edited the op to show the tags.


@AlaaJ
When posting anything that contains either < or > symbols you need to add spaces either side.

oh thanks

I mean by tags (< START:LOC > < END > <start:loc style="color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);"><end>)so I would take words in between. Is not necessary to be city
I used this formula
=MID(B2,FIND("< START:LOC ><start:loc>"</start:loc>,B2)+1,FIND("< END ><end>"</end>,B2)-FIND("< START:LOC ><start:loc>"</start:loc>,B2)-1)</end></start:loc>
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top