• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Excel programming help

alphatarget1

Diamond Member
This might be really a n00b question but nevertheless... I'm trying to figure this out.

Let's say I have an array of data:

1 100 90
2 50 90
3 10 90
4 0.5 90
5 0.125 90
6 0.0001 90
7 0.0000001 90

Basically I'm trying to program something so that I can use the slope function to determine the slope of the 2nd column. and have the program select the range that the line best fits. The slope converges to 0...

I set up a cell that does the slope calculation, and I can tell it to iterate until the slope matches a certain precision. What I don't know how to do is how to tell the program to look at a certain range when the 3rd column equals a certain value, and how to get VBA to automatically go down a row when the precision is not met...

any ideas?
 
You need a loop to iterate through the range. What should the code do when it finds what you want it to find?
 
Originally posted by: KLin
You need a loop to iterate through the range. What should the code do when it finds what you want it to find?

I just want it to export the number to a certain cell. I'm thinking once the program finds the right range of data then the program would do an average of the data points to give me the number if that makes any sense.
 
Originally posted by: KLin
You need a loop to iterate through the range. What should the code do when it finds what you want it to find?

Okay I reread it... For instance, let's say the 3rd column's value is not 90 anymore. I want the code to stop and select all the rows that have 90 in the 3rd column, and the calculate the slope with the data from the 1st and 2nd column.

Yeah, I'm totally a noob in this.
 
I am a little confused. You want to do linear regression on the series of numbers in the 2nd column(y) against the first(x), model a y=mx+b function from this, and then do what with that equation?

Or you want to get the slope from something else? In that case what's x, what's y?

In terms of your numbers what is a range and a datapoint?
 
Back
Top