Vlookup in Excel

G

Guest

I am using Vlookup and using lookup_values that do not have an exact match.
Vlookup automatically uses the next largest value that is less than
lookup_value. I want to use the next largest value that is greater than
lookup_value.

ex: vlookup(A1, C20-Q39, B2)
It ouputs K32, but I would like K33.
 
P

Peo Sjoblom

One way

=INDEX(C20:Q39,MATCH(SMALL(C20:C39,COUNTIF(C20:C39,"<"&A1)+1),C20:C39,0),B2)

assuming B2 holds the index number for the columns in your example it would
hold 9 to get to column K
 
A

Aladin Akyurek

Assuming that the lookup area/table is sorted in ascending order on its
MatchRange (i.e., on its first column)...

=INDEX(ReturnRange,MATCH(A1,MatchRange,1)+IF(A1<MAX(MatchRange),LOOKUP(A1,MatchRange)<>A1),0)

In fact, you also need a decision rule in case A1 < MIN(MatchRange)

Note also that the foregoing uses MAX which presupposes a numeric
MatchRange.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top