Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 59
Default vlookup - find an alternative approximate match

With vlookup, and a range lookup value of TRUE, when there is no exact match,
is it possible to return the smallest value that is greater than the lookup
value (rather than next largest value that is less than lookup value)? Thank
you.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default vlookup - find an alternative approximate match

One way...

A1 = lookup_value
G1:H10 = table_array

Array entered** :

=INDEX(H1:H10,MATCH(TRUE,G1:G10=A1,0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

That would be the equivalent of:

=VLOOKUP(A1,G1:H10,2,TRUE)

Except it will return the *next higher* value when an exact match isn't
found.

--
Biff
Microsoft Excel MVP


"Graeme" wrote in message
...
With vlookup, and a range lookup value of TRUE, when there is no exact
match,
is it possible to return the smallest value that is greater than the
lookup
value (rather than next largest value that is less than lookup value)?
Thank
you.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default vlookup - find an alternative approximate match

Another way - *non* array option:

With datalist in A1 to B20, and lookup value in C1,
try this:

=INDEX(B1:B20,MATCH(SMALL(A1:A20,COUNTIF(A1:A20,"< "&C1)+1),A1:A20,0))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Graeme" wrote in message
...
With vlookup, and a range lookup value of TRUE, when there is no exact

match,
is it possible to return the smallest value that is greater than the

lookup
value (rather than next largest value that is less than lookup value)?

Thank
you.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default vlookup - find an alternative approximate match

"Ragdyer" wrote...
Another way - *non* array option:

With datalist in A1 to B20, and lookup value in C1,
try this:

=INDEX(B1:B20,MATCH(SMALL(A1:A20,COUNTIF(A1:A20," <"&C1)+1),A1:A20,0))

....

So close!

The MATCH and SMALL calls are superfluous when the first column of the
lookup range is sorted in ascending order. The general form

=INDEX(table,COUNTIF(INDEX(table,0,1),"<"&value_so ught)
+1,column_sought)

and the particular form matching your formula

=INDEX(B1:B20,COUNTIF(A1:A20,"<"&C1)+1)

produce the desired result. Further, these forms work when col A
contains text.
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default vlookup - find an alternative approximate match

Point well taken Harlan!

My test data wasn't sorted, but in retrospect, it should definitely have
been, since the OP's entire question revolved around *inexact* matches.

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Harlan Grove" wrote in message
...
"Ragdyer" wrote...
Another way - *non* array option:

With datalist in A1 to B20, and lookup value in C1,
try this:

=INDEX(B1:B20,MATCH(SMALL(A1:A20,COUNTIF(A1:A20," <"&C1)+1),A1:A20,0))

...

So close!

The MATCH and SMALL calls are superfluous when the first column of the
lookup range is sorted in ascending order. The general form

=INDEX(table,COUNTIF(INDEX(table,0,1),"<"&value_so ught)
+1,column_sought)

and the particular form matching your formula

=INDEX(B1:B20,COUNTIF(A1:A20,"<"&C1)+1)

produce the desired result. Further, these forms work when col A
contains text.


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
Approximate match on string of text Pierre Excel Worksheet Functions 7 May 16th 09 10:27 PM
How do I match using partial or approximate values? gear350z Excel Worksheet Functions 3 September 5th 08 07:03 PM
Vlookup Approximate Match Question Craig Excel Worksheet Functions 4 August 21st 07 05:34 AM
Approximate matches with vlookup? Keith R Excel Worksheet Functions 2 March 30th 07 06:09 PM
Vlookup approximate match question. Bill Excel Worksheet Functions 4 September 1st 06 08:44 PM


All times are GMT +1. The time now is 03:29 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"