Hola!
I have a need to use the Slope function on a range of values that include zero’s in the end cells and the position the zero’s start changes ever week. For example:
SLOPE(E59:E72,J59:J72)
The first range, the Y-axis, may currently have the first 10 cells filled with non-zero values, while the remaining cells are all zero values. Every week a new row of data is added from another sheet.
The second range, the X-axis, is filled with a sequential number set, ie 1-14.
But the SLOPE function does not return the correct results if I select the entire range; I need to have it stop when it see’s the first zero in the range.
I can use the MATCH function to find the ‘relative’ row number’ in the range where the zero’s start, then just subtract 1, but the SLOPE function needs absolute cell positions.
In this case MATCH returns “14”, which I need to somehow turn into “$E$72” so I can give SLOPE the correct range to work with for that week. I will use the same formula in the other range as well so they match.
So I need to come up with a way to convert/derive an absolute cell position from: MATCH(0,E59:E74,0). I think I can then stick that function in the SLOPE formula so it will then only use the range w/o any zero’s that changes each week.
If I can get something to work, it will save me having to manually update the range values every week when new data comes in. Perhaps there is something better than MATCH for this task; it seemed the simplest approach but I just need to convert that relative array position to the real spreadsheet position.
Thanks.
Monty
Update: I experimented some more and came up with:
ADDRESS(MATCH(0,E59:E74,0)-1,5, 1, ) which produces “$E$13”.
But that is not something that produces “$E$71” or just “E71”, which is the actual spreadsheet cell reference I need to plugin to the SLOPE function.