title: How do I pass a variable to Linest for the last row number?
body: <p>What I'm trying to do is pass the variable row (which is the last line in a dynamic array) to the Linest function to perform a regression analysis.</p>
  
  <pre><code>=LINEST(R[5]C[-7]:R[row]C[-7],R[5]C[1]:R[row]C[8])
  </code></pre>
  
  <p>Excel gives me <code>Runtime error 1004</code> when it runs the above statement. It works fine if I don't use the variable row but an actual number.</p>