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>[TABLE="width: 0"]
<colgroup><col style="width: 219px"><col width="100"></colgroup><tbody>[TR]
[TD]Original Text[/TD]
[TD]Intended Text[/TD]
[/TR]
[TR]
[TD]They go with "Jack" to the farm.[/TD]
[TD]"Jack"[/TD]
[/TR]
[TR]
[TD]"New York" is in "US"[/TD]
[TD]"New York" "US"[/TD]
[/TR]
[TR]
[TD]I go to "school"[/TD]
[TD]"school"[/TD]
[/TR]
</tbody>[/TABLE]


Much appreciated.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
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>[TABLE="width: 0"]
<colgroup><col style="width: 219px"><col width="100"></colgroup><tbody>[TR]
[TD]Original Text[/TD]
[TD]Intended Text[/TD]
[/TR]
</tbody>[/TABLE]
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,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

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