View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme Bernard Liengme is offline
external usenet poster
 
Posts: 4,393
Default lowest of two closest numbers

Here is my offering; I am looking forward to T Valko's - he is a wiz at this
sort of thing. I hope by range you meant a single column (if not, delete my
message)

I will use numbers in A1:A20
In B2 enter =ABS(A1-A2); copy down to B20
In cell were you want the smallest number of the pair with minimum
difference enter
=MIN(INDEX(A2:A20,MATCH(MIN(B2:B20),B2:B20,0)),IND EX(A1:A19,MATCH(MIN(B2:B20),B2:B20,0)))
I did a few tests and it seems to work. But caveat empor!
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Susie (SFAngelgirl)" <Susie wrote
in message ...
excel 2003
In comparing a range of numbers; I need to find the two closest numbers
and
have the lowest value returned. Anybody?

Susie - SFAngelgirl