View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Sheeloo[_3_] Sheeloo[_3_] is offline
external usenet poster
 
Posts: 1,805
Default How to determine the closest value?

After sorting
=MATCH(B1,A:A,1)
will give you the position of 153

=INDEX(A:A,MATCH(B1,A:A,1)) will give you 153...

"Eric" wrote:

Thank you very much for suggestions
Do you have any suggestions on how to use Index function to determine the
value instead of VLookup?
Thank everyone for any suggestions
Eric

"Sheeloo" wrote:

Sort Column A in Ascending order then enter this in C1
==VLOOKUP(B1,A:A,1,TRUE)

"Eric" wrote:

Does anyone have any suggestions on how to determine the closeest number?

Example One
There is a list of number under column A
191,189,183,177,175,171,167,165,159,153,151
and there is a given number in cell B1, 154.
I would like to determine the closest number, which match with the number in
cell B1. On above example, it should return 153 in cell C1.

Example Two
There is a list of number under column A
191,189,183,177,175,171,167,165,155,153,151
and there is a given number in cell B1, 154.
I would like to determine the closest number, which match with the number in
cell B1. On above example, if the given number matches two numbers, which the
difference is the same, then it should return 153 in cell C1.
Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric