title: Dynamic calculation in Excel based on a cell value
body: <p>I've got a challenge in Excel i hope you guys can solve for me. </p>
  
  <p>I have a drop down list (weeks) where i select the week 2015-18 to 2016-17. (nr 1 in picture)</p>
  
  <p>In the cell called LY (nr 2 in picture) I want that to type the result of a dynamic sum range, based on the weeks input.</p>
  
  <p><a href="http://postimg.org/image/53ol9oebp/" rel="nofollow">Picture of setup of the text above</a></p>
  
  <p>The calculation logic is:</p>
  
  <ul>
  <li>If i select week 2015-20, the VBA or formula should sum(F5:F7)/(G5:G7). </li>
  <li>So in other words, I want a dynamic calculation that starts from week 2015-18 (F5/G5) and then sums the values down to the value that i have selected in "Weeks"</li>
  </ul>
  
  <p><a href="http://postimg.org/image/8qm5cguq1/" rel="nofollow">Picture of the setup of the logic values</a></p>
  
  <ul>
  <li>The value of this calculation should be shown in LY (first picture, nr 2).</li>
  </ul>
  
  <p>I really hope you can solve this for me. I've got more rows to calculate, so if you could come up with a "global" code that works for that, it would be great</p>