So here is my situation:
I've a large amount of data, with x values of 1-18, but y values that vary.. some of which are blanks because the equation is /0 - arranged in rows.
I am trying to get the m^3, m^2, m, c coefficients of the polynomial trend line for every row of y values.. y1, y2 etc.
Because I can not use Linest() with blanks I am trying to use VBA to copy out all the relevant (non-blank) y-values, but also removing the associated x-value for that row.
Here is an example section of the data - but there are more rows
x 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 m3 m2 m c
y1 0.0 1.0 2.0 2.0 1.0 0.0 1.0 - 2.0 2.0 1.0 2.0 2.5 1.0 1.0 2.0 1.0 4.0 ? ? ? ?
y2 0.0 1.0 - 2.0 2.0 0.0 2.0 2.0 0.0 1.7 4.0 1.0 2.0 2.0 4.0 1.0 3.0 2.0 ? ? ? ?
So far I have been trying without much success.
So far I have been trying something like this, but without success, but this is my first ever VBA attempts.. so sorry if I am unaware of the obvious!!
'code to identify known_y and known_x ranges
For each testvalue in known_y
If testvalue indicates that this point should be included in regression
then copy this data point (both known_y and known_x value for this point) either into an array (if I want to invoke LINEST() from within VBA) or into another range in the spreadsheet.
Next testvalue
Invoke LINEST() using the copied data
If anyone could help it would be much appreciated!!