Vlookup Approximate Match Question
Actually, its the smallest *row* that's returned.
If you would need the *larger* row number to display it's value in the case
of a tie, try this formula, also an *array*:
=INDEX(B1:B5,MATCH(MAX(IF(ABS(A1:A5-C1)=MIN(ABS(A1:A5-C1)),A1:A5)),A1:A5,0))
--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead of
the regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.
--
HTH,
RD
---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Ragdyer" wrote in message
...
Try this *array* formula, with the lookup range in A1 to A50,
the data to be returned in B1 to B50,
and the value to lookup entered in C1:
=INDEX(B1:B50,MATCH(MIN(ABS(A1:A50-C1)),ABS(A1:A50-C1),0))
--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead
of
the regular <Enter, which will *automatically* enclose the formula in
curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.
If the lookup value is in the *middle* of 2 values in the lookup range,
the row containing the *smallest* value will be returned.
--
HTH,
RD
---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Craig" wrote in message
...
Hi...
In the Vlookup approximate match situation, (range lookup argument is
true)
the function returns a value on the same row to the closest matching
value in
a lookup table that is less than or equal to the lookup value...is there
anyway to change it so it returns a value on the same row to the closest
matching value in to the lookup value even though the closest value may
be
higher than the lookup value?
thank you!
Craig
|