Find number closest to 0

S

snappertime

I want to find the number in a column that is closest to 0 (number may be
positive or negative) and return a number in an adjacent cell, if no number
in the adjacent cell I want the next number that is closest to 0 that does
have a number in the adjacent cell.
eg.
offset chainage
-88.972
-2.174
22.693 215.459
24.099 231.342
93.596 355.034

I want 215.459 to be returned.
 
R

Ron Rosenfeld

I want to find the number in a column that is closest to 0 (number may be
positive or negative) and return a number in an adjacent cell, if no number
in the adjacent cell I want the next number that is closest to 0 that does
have a number in the adjacent cell.
eg.
offset chainage
-88.972
-2.174
22.693 215.459
24.099 231.342
93.596 355.034

I want 215.459 to be returned.

Enter this as an **array** formula:

=INDEX(chainage,MATCH(MIN(IF(ISNUMBER(chainage),offset)),offset,0))

To enter an **array** formula, hold down <ctrl><shift> while hitting <enter>.
If you do it correctly, Excel will place braces {...} around the formula.
--ron
 
S

snappertime

Thanks mate that works

Ron Rosenfeld said:
Enter this as an **array** formula:

=INDEX(chainage,MATCH(MIN(IF(ISNUMBER(chainage),offset)),offset,0))

To enter an **array** formula, hold down <ctrl><shift> while hitting <enter>.
If you do it correctly, Excel will place braces {...} around the formula.
--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top