Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
yhm yhm is offline
external usenet poster
 
Posts: 2
Default Vlookup to return larger value

Hi,

I have a list of values as follows:
X Y
50 2
80 4
100 6

When I lookup the value of x=85, I would like the returned value to be 6
instead of 4. How do I do that?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Vlookup to return larger value

There has to be an easier way and I hope someone posts it but for now try:-

=IF(ISNA(VLOOKUP(C1,A1:B30,2,FALSE)),LARGE(B1:B30, RANK(VLOOKUP(C1,A1:B30,2,TRUE),B1:B30)-1),"")

Lookup value in C1

Array in A1:B30

Mike

"yhm" wrote:

Hi,

I have a list of values as follows:
X Y
50 2
80 4
100 6

When I lookup the value of x=85, I would like the returned value to be 6
instead of 4. How do I do that?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 524
Default Vlookup to return larger value

Wed, 4 Jul 2007 04:22:00 -0700 from yhm
:
Hi,

I have a list of values as follows:
X Y
50 2
80 4
100 6

When I lookup the value of x=85, I would like the returned value to be 6
instead of 4. How do I do that?


I don't know of a way to do it directly in VLOOKUP, but you can
change your table to this:
-100 6
-80 4
-50 2
and then look up the negative of the value you're actually trying to
look up, e.g. -85 instead of 85.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Vlookup to return larger value

Oops an error. But the solution just lengthens the formula!!

=IF(ISNA(VLOOKUP(C1,A1:B30,2,FALSE)),LARGE(B1:B30, RANK(VLOOKUP(C1,A1:B30,2,TRUE),B1:B30)-1),VLOOKUP(C1,A1:B30,2,FALSE))

Mike

"yhm" wrote:

Hi,

I have a list of values as follows:
X Y
50 2
80 4
100 6

When I lookup the value of x=85, I would like the returned value to be 6
instead of 4. How do I do that?

  #5   Report Post  
Posted to microsoft.public.excel.misc
yhm yhm is offline
external usenet poster
 
Posts: 2
Default Vlookup to return larger value

Hi Mike,

I have tried your formula, but there seems to be a problem.....eg my data is
as follows:
X Y
700 616
750 1,218
800 868
850 1,500
When I try to search for a value of X=799, instead of returning Y=868, the
computer returns Y=1500. Why is that? Is there any way to correct it? Thanks!
;-)
"Mike H" wrote:

Oops an error. But the solution just lengthens the formula!!

=IF(ISNA(VLOOKUP(C1,A1:B30,2,FALSE)),LARGE(B1:B30, RANK(VLOOKUP(C1,A1:B30,2,TRUE),B1:B30)-1),VLOOKUP(C1,A1:B30,2,FALSE))

Mike

"yhm" wrote:

Hi,

I have a list of values as follows:
X Y
50 2
80 4
100 6

When I lookup the value of x=85, I would like the returned value to be 6
instead of 4. How do I do that?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Vlookup to return larger value

Hi

If the Xs can be sorted descending you can use:

=INDEX(A2:B4;MATCH(C4;A2:A4;-1);2)

provided the array is in A2:B4, the lookup value is in C4, the lookup range
is in A2:A4 and the value you want returned is in the second column of the
array (B in this case).

HTH.

/Sune

"yhm" wrote:

Hi,

I have a list of values as follows:
X Y
50 2
80 4
100 6

When I lookup the value of x=85, I would like the returned value to be 6
instead of 4. How do I do that?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP to return first hit Max Excel Worksheet Functions 2 February 28th 06 02:29 PM
lookup to return larger value Christobee Excel Worksheet Functions 2 November 22nd 05 06:49 AM
lookup to return larger value Christobee Excel Worksheet Functions 4 November 22nd 05 06:48 AM
Want VLookup to Return the row above JoOwl0 Excel Worksheet Functions 8 April 23rd 05 07:16 PM
Vlookup - return row no. instead of value automne Excel Discussion (Misc queries) 2 March 7th 05 12:38 AM


All times are GMT +1. The time now is 02:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"