W
Wally
Hi,
I need to find a value in an array that closest matches a
given value. For instance;
let's say that the following array exist
A | B |
1 3.2 100.3
2 4.6 120.5
3 5.5 136.1
4 6.3 145.2
5 7.1 166.8
6 8.7 181.4
7 9.3 200.2
I am using MATCH(6.8,A1:A7,1) This returns 4 because the
4th position holds the highest value smaller than or equal
to (6.8). So that tells me the row #. Now, I need to
find which value is closer to (6.8), (6.3) or (7.1)
Is there an easier way to do this or how do I use the
known row # (in this instance - (4) to compare the values?
e.g = If(6.8 - [value in row(4)col(1)] < [value in row
(4+1)] - 6.8, Value in row(4)col(1), row(4+1)col(1))
Hope this is not too vague.
Thanks for any help
Wally
I need to find a value in an array that closest matches a
given value. For instance;
let's say that the following array exist
A | B |
1 3.2 100.3
2 4.6 120.5
3 5.5 136.1
4 6.3 145.2
5 7.1 166.8
6 8.7 181.4
7 9.3 200.2
I am using MATCH(6.8,A1:A7,1) This returns 4 because the
4th position holds the highest value smaller than or equal
to (6.8). So that tells me the row #. Now, I need to
find which value is closer to (6.8), (6.3) or (7.1)
Is there an easier way to do this or how do I use the
known row # (in this instance - (4) to compare the values?
e.g = If(6.8 - [value in row(4)col(1)] < [value in row
(4+1)] - 6.8, Value in row(4)col(1), row(4+1)col(1))
Hope this is not too vague.
Thanks for any help
Wally