Extract text in double quotes including the the double quotes

yexcelk

New Member
Joined
Sep 10, 2017
Messages
3
Hello everyone,

I am trying to extract text in double quotes including the double no matter what position they occur in.

for example:

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
Original TextIntended Text
They go with "Jack" to the farm."Jack"
"New York" is in "US""New York" "US"
I go to "school""school"

<colgroup><col style="width: 219px"><col width="100"></colgroup><tbody>
</tbody>


Much appreciated.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hello everyone,

I am trying to extract text in double quotes including the double no matter what position they occur in.

for example:

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
Original TextIntended Text

<colgroup><col style="width: 219px"><col width="100"></colgroup><tbody>
</tbody>
Intended text where... in a single cells or in multiple columns?
 
Last edited:
Upvote 0
Assuming your data starts in cell A1, put this formula in cell B1 and copy it across for as many columns as you think you will ever have words to put in them, then copy all of those formula down to the bottom of your data (or beyond if you think you might add more rows of data in the future)...

=SUBSTITUTE(""""&TRIM(MID(SUBSTITUTE($A1,"""",REPT(" ",300)),(2*COLUMNS($B:B)-1)*300,300))&"""","""""","")

Note: This formula assumes the text in any one cell will never be more than 300 characters. If your text could be longer, then change all of the 300's to whatever than maximum is (but be warned, there is a point of diminishing returns beyond which the formula will stop working, so don't make the number artificially high just to cover anything).
 
Upvote 0
Assuming your data starts in cell A1, put this formula in cell B1 and copy it across for as many columns as you think you will ever have words to put in them, then copy all of those formula down to the bottom of your data (or beyond if you think you might add more rows of data in the future)...

=SUBSTITUTE(""""&TRIM(MID(SUBSTITUTE($A1,"""",REPT(" ",300)),(2*COLUMNS($B:B)-1)*300,300))&"""","""""","")

Note: This formula assumes the text in any one cell will never be more than 300 characters. If your text could be longer, then change all of the 300's to whatever than maximum is (but be warned, there is a point of diminishing returns beyond which the formula will stop working, so don't make the number artificially high just to cover anything).


Thank you very much!
 
Upvote 0

Forum statistics

Threads
1,216,170
Messages
6,129,277
Members
449,498
Latest member
Lee_ray

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