title: Excel Find the text between the last two underscores
body: <p>I need an excel formula to find the text between the last two underscores in an excel cell:</p>
  
  <p>i.e.</p>
  
  <blockquote>
    <p><code>AAA_BBB_CCC_DDDD_E =&gt; DDDD<br>
    AAA_BBB_CCC_DDD_EEE_E =&gt; EEE<br>
    AAA_BBB_CCC_DDD_EEE_F_ =&gt; F<br>
    AAA_BBB_CCC_DDD_EE_GGGGGGGGGG =&gt; EE<br>
    AAA_BBB_CCC_DDD_EEE_FFF_GGGGGGGGGGGG_H =&gt; GGGGGGGGGGGG</code> </p>
  </blockquote>
  
  <p>The formula i got is based on the last index of:
  <a href="http://geekswithblogs.net/prash/archive/2011/11/02/excel-last-index-of.aspx" rel="nofollow">EXCEL LAST INDEX OF</a></p>
  
  <blockquote>
    <p><code>=RIGHT(LEFT(A2,SEARCH("@",SUBSTITUTE(A2,"_","@",LEN(A2)-LEN(SUBSTITUTE(A2,"_",""))))-1),LEN(LEFT(A2,SEARCH("@",SUBSTITUTE(A2,"_","@",LEN(A2)-LEN(SUBSTITUTE(A2,"_",""))))-1))-SEARCH("@",SUBSTITUTE(LEFT(A2,SEARCH("@",SUBSTITUTE(A2,"_","@",LEN(A2)-LEN(SUBSTITUTE(A2,"_",""))))-1),"_","@",LEN(LEFT(A2,SEARCH("@",SUBSTITUTE(A2,"_","@",LEN(A2)-LEN(SUBSTITUTE(A2,"_",""))))-1))-LEN(SUBSTITUTE(LEFT(A2,SEARCH("@",SUBSTITUTE(A2,"_","@",LEN(A2)-LEN(SUBSTITUTE(A2,"_",""))))-1),"_","")))))</code></p>
  </blockquote>
  
  <p>I need to make this less complicated, any ideas?</p>