title: Translating a long Excel formula into Dplyr
body: <p>This is probably a very untraditional question, but I'm totally stumped. I just took over a project at work from a former co-worker who has been doing all of his reporting in Excel. It has lead to a ton of headaches with broken workbooks and what not. I've been able to translate almost all of his formula into some dplyr compatible. Except for this one problem:</p>
  
  <pre><code>=if (C3="Yes" ,if (B20&gt;0, floor(B20/C4) + if (G3 &lt;= mod(B20,C14), 1, ),),)
  </code></pre>
  
  <p>Does anyone have any ideas? I know it would involve <code>case_when</code> but I'm stumped after that!</p>