title: Substitute first X occurrences
body: <p>I can replace all occurrences</p>
  
  <pre><code>=SUBSTITUTE("a_b_c_d", "_", "")
  </code></pre>
  
  <p>to get the string "abcd". Or I can replace the 1st occurrence</p>
  
  <pre><code>=SUBSTITUTE("a_b_c_d", "_", "", 1)
  </code></pre>
  
  <p>to get the string "ab_c_d". But how can I replace the first X occurrences? I don't know a way to recursively call a function. and <code>=SUBSTITUTE(SUBSTITUTE("a_b_c_d", "_", "", 1), "_", "", 1)</code> is not really an acceptable answer because it would always just replace the first 2 occurrences but what if I need to replace 2 or 3 or 4 or X occurrences, but not all occurrences?</p>