Formula to keep specific words only based on position

IamNewbee

New Member
Joined
Sep 18, 2017
Messages
7
Hi guys, I am new to excel formulas and I am struggling with a formula.

I have a line of text,of which I want to keep only the 2nd and 3rd word and remove the rest. for example: cell A1 contains 'I love reading books' . I want to write a formula/vba code whichever is easier to give output in B1 as 'love reading'.

Could someone help me with this? Thanks in advance :)
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Not sure what you want to happen if there are fewer than three words. Here's a potential solution:


Book1
AB
1I love reading bookslove reading
2Sometimes wbd rocks the cradlewbd rocks
3SingleSingle
4Two wordswords
Sheet1
Cell Formulas
RangeFormula
B1=MID($A1,IFERROR(FIND(CHAR(1),SUBSTITUTE($A1," ",CHAR(1),1)),0)+1,IFERROR(FIND(CHAR(1),SUBSTITUTE($A1," ",CHAR(1),3)),LEN($A1)+1)-IFERROR(FIND(CHAR(1),SUBSTITUTE($A1," ",CHAR(1),1)),0)-1)


WBD
 
Upvote 0
you could try this formula in B1 ...

=MID(A1,FIND(" ",A1,1)+1,LEN(A1)-FIND(" ",A1,FIND(" ",A1)+2)-1)

Kind regards,

Chris
 
Upvote 0
at the moment I am able to remove the first word using formula RIGHT(A1,LEN(A1)-FIND(" ",A1))... Struggling with the remaining words.
 
Upvote 0
Hi, just another option - different result for the single word though.


Excel 2013/2016
AB
1I love reading bookslove reading
2Sometimes wbd rocks the cradlewbd rocks
3Single
4Two wordswords
Sheet2
Cell Formulas
RangeFormula
B1=TRIM(LEFT(SUBSTITUTE(MID(A1,FIND(" ",A1&" ")+1,999)," ",REPT(" ",999),2),999))
 
Upvote 0
Hi, just another option - different result for the single word though.

Excel 2013/2016
AB
I love reading books
Sometimes wbd rocks the cradlewbd rocks
Single
Two wordswords

<colgroup><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="bgcolor: #FFFF00"]love reading[/TD]

[TD="align: center"]2[/TD]

[TD="align: center"]3[/TD]

[TD="align: center"]4[/TD]

</tbody>
Sheet2

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B1[/TH]
[TD="align: left"]=TRIM(LEFT(SUBSTITUTE(MID(A1,FIND(" ",A1&" ")+1,999)," ",REPT(" ",999),2),999))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Even this works wonders....easier to understand. Thank you so much for your help :)
 
Upvote 0

Forum statistics

Threads
1,223,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

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