#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 390
Default Lookup

When using VLOOKUP, the lookup value is compared to the first column. If
there is no exact match, it returns the closest match that is LOWER than the
lookup value. Is there a way that I can specify it returns the closest match
that is HIGHER than the lookup value?

Part of my worksheet has a series of engine sizes in the left hand column.
According to user input of their vehicle's engine size, the lookup should
return a value accordingly. My current list of sizes is entered as:
(up to)
2000, 2500, 3000, etc.

Naturally with engines, they range greatly in size and if my engine is (for
example) 2200cc, I want to return a value from the 2000 to 2500 row (simply
listed in my sheet as '2500') This would require Vlookup to return the next
higher value.

Thanks in advance for any help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Lookup

Assume the lookup table is in cols A & B, from row1 down
col A = 2000,2500,3000,etc (capacity values in ascending order)
col B = corresponding ref values

Assume in D2 down are listed the capacity values to be looked up,
eg: 2200, 2800, 2500, etc

In E2:
=IF(ISNUMBER(MATCH(D2,$A:$A,0)),VLOOKUP(D2,$A:$B,2 ),INDEX($B:$B,MATCH(D2,$A:$A)+1))
Copy down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Bill" wrote:
When using VLOOKUP, the lookup value is compared to the first column. If
there is no exact match, it returns the closest match that is LOWER than the
lookup value. Is there a way that I can specify it returns the closest match
that is HIGHER than the lookup value?

Part of my worksheet has a series of engine sizes in the left hand column.
According to user input of their vehicle's engine size, the lookup should
return a value accordingly. My current list of sizes is entered as:
(up to)
2000, 2500, 3000, etc.

Naturally with engines, they range greatly in size and if my engine is (for
example) 2200cc, I want to return a value from the 2000 to 2500 row (simply
listed in my sheet as '2500') This would require Vlookup to return the next
higher value.

Thanks in advance for any help.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 390
Default Lookup

Worked great - thank you!

Bill

"Max" wrote:

Assume the lookup table is in cols A & B, from row1 down
col A = 2000,2500,3000,etc (capacity values in ascending order)
col B = corresponding ref values

Assume in D2 down are listed the capacity values to be looked up,
eg: 2200, 2800, 2500, etc

In E2:
=IF(ISNUMBER(MATCH(D2,$A:$A,0)),VLOOKUP(D2,$A:$B,2 ),INDEX($B:$B,MATCH(D2,$A:$A)+1))
Copy down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Bill" wrote:
When using VLOOKUP, the lookup value is compared to the first column. If
there is no exact match, it returns the closest match that is LOWER than the
lookup value. Is there a way that I can specify it returns the closest match
that is HIGHER than the lookup value?

Part of my worksheet has a series of engine sizes in the left hand column.
According to user input of their vehicle's engine size, the lookup should
return a value accordingly. My current list of sizes is entered as:
(up to)
2000, 2500, 3000, etc.

Naturally with engines, they range greatly in size and if my engine is (for
example) 2200cc, I want to return a value from the 2000 to 2500 row (simply
listed in my sheet as '2500') This would require Vlookup to return the next
higher value.

Thanks in advance for any help.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Lookup

Welcome, Bill. Great to hear that.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Bill" wrote in message
...
Worked great - thank you!

Bill



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
Matrix lookup/mulitple criteria lookup MarkFranklin Excel Discussion (Misc queries) 3 March 31st 08 10:15 AM
Get Cell Address From Lookup (Alternative to Lookup) ryguy7272 Excel Worksheet Functions 12 September 28th 07 10:36 PM
Join 2 Lists - Lookup value in 1 list & use result in 2nd lookup JBush Excel Worksheet Functions 3 January 3rd 07 11:14 PM
Sumproduct - Condition based on lookup of a Lookup Hari Excel Discussion (Misc queries) 12 May 31st 06 09:28 AM
Pivot table doing a lookup without using the lookup function? NGASGELI Excel Discussion (Misc queries) 0 August 2nd 05 05:08 AM


All times are GMT +1. The time now is 01:06 PM.

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

About Us

"It's about Microsoft Excel"