title: How do I write a formula that replaces a text string that contains quote marks?
body: <p>I have a cell in Excel, which, for the sake of example, contains this:</p>
  
  <pre><code>&lt;text style="bold"&gt;Text.&lt;/text&gt;
  &lt;text style="bold"&gt;More text.&lt;/text&gt;
  &lt;text style="bold"&gt;&lt;/text&gt;
  &lt;text style="bold"&gt;Other text.&lt;/text&gt;
  &lt;text style="bold"&gt;&lt;/text&gt;
  </code></pre>
  
  <p>Now, I would like to write a formula that deletes <strong>all</strong> text style tags that don't contain any text, i.e. all <code>&lt;text style="bold"&gt;&lt;/text&gt;</code>. </p>
  
  <p>Since the text string contains quotes, this formula doesn't work:</p>
  
  <pre><code>=SUBSTITUTE(a1,"&lt;text style="bold"&gt;&lt;/text&gt;", "")
  </code></pre>
  
  <p>I have also tried to work around this by writing this formula</p>
  
  <pre><code>=SUBSTITUTE(a1,CONCATENATE("&lt;text style=", char(34), "bold", char(34), "&gt;","&lt;/text&gt;"), "")
  </code></pre>
  
  <p>but that doesn't seem to work either.</p>
  
  <p>How do I write a formula that replaces a text string that contains quote marks?</p>
  
  <p>Please help.</p>