If a value is not found in a range, I would like it to return the smallest
value greater than itself.A B C
i.e. 8 2
10 4
12 6
By default if I searched for 9, and needed the info from column C, I would 2
as my result, but instead I would like to get 4 as the result.
Sort your lookup data on col A descending
=INDEX(C1:C3,MATCH(9,A1:A3,-1))
HTH
--
AP
quot;BGquot; gt; a écrit dans le message de news:
...
gt; If a value is not found in a range, I would like it to return the smallest
gt; value greater than itself.
gt;
gt;
gt; A B C
gt; i.e. 8 2
gt; 10 4
gt; 12 6
gt;
gt; By default if I searched for 9, and needed the info from column C, I would
gt; 2
gt; as my result, but instead I would like to get 4 as the result.
If you use MATCH( ) then you will get the (relative) position in the
range - you can add 1 onto this and feed this into an INDEX( ) function
to get what you want.
Hope this helps.
PeteWhat if that relative is an exact match or the last one?
--
HTH
Bob Phillips
(remove xxx from email address if mailing direct)
quot;Pete_UKquot; gt; wrote in message oups.com...
gt; If you use MATCH( ) then you will get the (relative) position in the
gt; range - you can add 1 onto this and feed this into an INDEX( ) function
gt; to get what you want.
gt;
gt; Hope this helps.
gt;
gt; Pete
gt;
- Feb 22 Thu 2007 20:36
vlookup must return a value that is greater than
close
全站熱搜
留言列表
發表留言