title: Excel formula to extract string from text
body: <p>I'm using the following formula to extract a string from text in a cell by getting rid of <code>-DCS</code>. </p>
  
  <p>The text contained in the cell: <code>Q074-SARE_MANSONG-DCS</code></p>
  
  <p>Formula:<code>IF(ISNUMBER(SEARCH("DCS",H22)),LEFT(H22,FIND("@",SUBSTITUTE(H22,"-DCS","@",LEN(H22)-LEN(SUBSTITUTE(H22,"-",""))))-1),([@[&lt;HELPER&gt;&lt;SITE&gt;]]))</code></p>
  
  <p>Desired reslut: <code>Q074-SARE_MANSONG</code></p>
  
  <p>The problem is that it is not working for all cells. Can someone please tell me what it is that I'm doing wrong. Thanks.</p>