title: Google Sheets Conditional Formula
body: <p>I am in need of a different formula for the same column cells depending on the values of another column.</p>
  
  <p>I am trying to avoid writing a five-line formula concatenating all of them into one because of readability and maintainability. It's quite possible for the formulas to be added, deleted and updated in future.</p>
  
  <p>here is a simplified example:</p>
  
  <p><a href="https://i.stack.imgur.com/DLprY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DLprY.png" alt="enter image description here"></a></p>
  
  <p>the formula I use for <code>deductions</code> right now is:</p>
  
  <pre><code>=IF(E7 = "salary", D7 * 0.2, IF(E7 = "rent", D7 * 0.15, D7)
  </code></pre>
  
  <p>Ideally, I would like to somehow call a separate formula in this <code>IF</code> statement instead of doing the calculations in place. The separate formulas, in this case, being <code>D7 * 0.15</code> and <code>D7 * 0.2</code> but in my case are more complicated.</p>
  
  <p>I can code JavaScript and I've read how to create custom functions that could do that (in js) but think there would be a more <code>spreadsheedian</code> way.</p>
  
  <p>So, is there a way to call separate formulas inside a formula and if not what is the best practice for this kind of situations.</p>