A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

VLOOKUP next greatest value?



 
 
Thread Tools Display Modes
  #1  
Old October 7th, 2003, 04:01 PM
bostitch
external usenet poster
 
Posts: n/a
Default VLOOKUP next greatest value?

I would like to find the SMALLEST value in an array that
is GREATER than lookup_value.

However VLOOKUP returns the LARGEST value in an array that
is LESS than or equal to lookup_value.

Any one know how to do this?

TIA

  #2  
Old October 7th, 2003, 04:17 PM
Peo Sjoblom
external usenet poster
 
Posts: n/a
Default VLOOKUP next greatest value?

One way

=INDEX(B1:B100,MATCH(SMALL(A1:A100,COUNTIF(A1:A100 ,""&C1)+1),A1:A100,0))

where a vlookup (which won't work of course) would look like

=VLOOKUP(A1:B100,2,TRUE)

--

Regards,

Peo Sjoblom


"bostitch" wrote in message
...
I would like to find the SMALLEST value in an array that
is GREATER than lookup_value.

However VLOOKUP returns the LARGEST value in an array that
is LESS than or equal to lookup_value.

Any one know how to do this?

TIA



  #3  
Old October 7th, 2003, 04:36 PM
Vasant Nanavati
external usenet poster
 
Posts: n/a
Default VLOOKUP next greatest value?

Hi:

Try:

=INDEX(Lookup_Range,MATCH(VLOOKUP(Lookup_Value,Loo kup_Range,1),Lookup_Range,
0)+1)

Regards,

Vasant.

"bostitch" wrote in message
...
I would like to find the SMALLEST value in an array that
is GREATER than lookup_value.

However VLOOKUP returns the LARGEST value in an array that
is LESS than or equal to lookup_value.

Any one know how to do this?

TIA



  #4  
Old October 7th, 2003, 06:51 PM
Harlan Grove
external usenet poster
 
Posts: n/a
Default VLOOKUP next greatest value?

"bostitch" wrote...
I would like to find the SMALLEST value in an array that
is GREATER than lookup_value.

However VLOOKUP returns the LARGEST value in an array that
is LESS than or equal to lookup_value.


Since VLOOKUP only does this when the first column in the table range is sorted
in ascending order and you're using nonexact matching, replace

=VLOOKUP(v,t,n)

with

=INDEX(t,MATCH(v,INDEX(t,0,1))+1,n)

*DON'T* use 0 as 3rd argument to MATCH - you could get a lot of #N/A errors when
there's no exact match for v in the first column of t.

--
Never attach files.
Snip unnecessary quoted text.
Never multipost (though crossposting is usually OK).
Don't change subject lines because it corrupts Google newsgroup archives.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.