Remove all text outside of " "

stonypaul

Board Regular
Joined
Jan 4, 2008
Messages
86
Greetings,

If I have a string such as the following in cell A1 what code would remove everything outside the speech marks, inclusive of the speech marks?

The Black Eyed Peas : "Meet Me Halfway"
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Greetings,

If I have a string such as the following in cell A1 what code would remove everything outside the speech marks, inclusive of the speech marks?

The Black Eyed Peas : "Meet Me Halfway"

Try...

=SUBSTITUTE(REPLACE(A2,1,FIND(CHAR(34),A2),""),CHAR(34),"")

if

Meet Me Halfway

is the desired result.
 
Upvote 0
Greetings,

If I have a string such as the following in cell A1 what code would remove everything outside the speech marks, inclusive of the speech marks?

The Black Eyed Peas : "Meet Me Halfway"
Try this...

=SUBSTITUTE(MID(A2,FIND(": ",A2)+3,50),RIGHT(A2),"")
 
Upvote 0
Improvement...

1 less function call and a few keystrokes shorter.

=SUBSTITUTE(MID(A2,FIND(": ",A2)+3,50),"""","")
Tweak...

Just in case you might have an entry like:

Pink Floyd : "Several Species Of Small Furry Animals Gathered Together In A Cave And Grooving With A Pict"

=SUBSTITUTE(MID(A2,FIND(": ",A2)+3,255),"""","")
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,882
Members
452,948
Latest member
Dupuhini

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