round to the nearest number

Copper Contributor

HELLO ,

I want to round the number in cell D6 to the nearest number in raw (2) in the table (I:T,2:12).

 

could you help me please,

thank you.

4 Replies

Hi

 

Classic INDEX() with double MATCH().

=INDEX($J$4:$T$13,MATCH(E4,$I$4:$I$13,1),MATCH(D4,$J$2:$T$2,1))

 

it round to ( .15 ) which isn't in raw (2) in the table (I:T,2:12).
the answer should be 2 not .15

That could be

=INDEX($J$2:$T$2,0,MATCH(MIN(INDEX(ABS($J$2:$T$2-D6),0)),INDEX(ABS($J$2:$T$2-D6),0),0))

if don't take into account possible float point calculation error.