Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 390
Default Vlookup approximate match question.

OK if I lookup Jan 5 {vlookup(jan 5, a1:b4, 2)} returns 2 since the function
returns the next largest value that is less than lookup_value. How do I get
the value for the next smallest value that is greater than the lookup_value?
In example below that would be 6 not 2.

Jan 1 2
Jan 7 6
Jan 13 0
Jan 15 8

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Vlookup approximate match question.

Insert a new cell A1, To get an offset:

Blank 2
Jan 1 6
Jan 7 0
Jan 13 8
Jan 15 8

then use

=VLOOKUP(DATEVALUE("jan 5"), A1:B5, 2)


HTH,
Bernie
MS Excel MVP


"Bill" wrote in message
...
OK if I lookup Jan 5 {vlookup(jan 5, a1:b4, 2)} returns 2 since the function
returns the next largest value that is less than lookup_value. How do I get
the value for the next smallest value that is greater than the lookup_value?
In example below that would be 6 not 2.

Jan 1 2
Jan 7 6
Jan 13 0
Jan 15 8

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Vlookup approximate match question.

And add one to all of your dates, except the last one.... sorry.

Blank 2
Jan 2 6
Jan 8 0
Jan 14 8
Jan 15 8

You could also change the blank to an early date... play around....

HTH,
Bernie
MS Excel MVP


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Insert a new cell A1, To get an offset:

Blank 2
Jan 1 6
Jan 7 0
Jan 13 8
Jan 15 8

then use

=VLOOKUP(DATEVALUE("jan 5"), A1:B5, 2)


HTH,
Bernie
MS Excel MVP


"Bill" wrote in message
...
OK if I lookup Jan 5 {vlookup(jan 5, a1:b4, 2)} returns 2 since the function
returns the next largest value that is less than lookup_value. How do I get
the value for the next smallest value that is greater than the lookup_value?
In example below that would be 6 not 2.

Jan 1 2
Jan 7 6
Jan 13 0
Jan 15 8

Thanks.





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 390
Default Vlookup approximate match question.

That would work, but I have a long list. I can make this solution work if I
have to. I guess I was hoping for some sort of change to the formula.

"Bernie Deitrick" wrote:

And add one to all of your dates, except the last one.... sorry.

Blank 2
Jan 2 6
Jan 8 0
Jan 14 8
Jan 15 8

You could also change the blank to an early date... play around....

HTH,
Bernie
MS Excel MVP


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Insert a new cell A1, To get an offset:

Blank 2
Jan 1 6
Jan 7 0
Jan 13 8
Jan 15 8

then use

=VLOOKUP(DATEVALUE("jan 5"), A1:B5, 2)


HTH,
Bernie
MS Excel MVP


"Bill" wrote in message
...
OK if I lookup Jan 5 {vlookup(jan 5, a1:b4, 2)} returns 2 since the function
returns the next largest value that is less than lookup_value. How do I get
the value for the next smallest value that is greater than the lookup_value?
In example below that would be 6 not 2.

Jan 1 2
Jan 7 6
Jan 13 0
Jan 15 8

Thanks.






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Vlookup approximate match question.

Then with your date value of 1/5 in cell D1:

=IF(ISERROR(MATCH(D1,A1:A4,FALSE)),INDEX(B1:B4,MAT CH(D1,A1:A4)+1),INDEX(B1:B4,MATCH(D1,A1:A4)))

HTH,
Bernie
MS Excel MVP


"Bill" wrote in message
...
That would work, but I have a long list. I can make this solution work if I
have to. I guess I was hoping for some sort of change to the formula.

"Bernie Deitrick" wrote:

And add one to all of your dates, except the last one.... sorry.

Blank 2
Jan 2 6
Jan 8 0
Jan 14 8
Jan 15 8

You could also change the blank to an early date... play around....

HTH,
Bernie
MS Excel MVP


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Insert a new cell A1, To get an offset:

Blank 2
Jan 1 6
Jan 7 0
Jan 13 8
Jan 15 8

then use

=VLOOKUP(DATEVALUE("jan 5"), A1:B5, 2)


HTH,
Bernie
MS Excel MVP


"Bill" wrote in message
...
OK if I lookup Jan 5 {vlookup(jan 5, a1:b4, 2)} returns 2 since the function
returns the next largest value that is less than lookup_value. How do I get
the value for the next smallest value that is greater than the lookup_value?
In example below that would be 6 not 2.

Jan 1 2
Jan 7 6
Jan 13 0
Jan 15 8

Thanks.









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 Question mllestecchino Excel Worksheet Functions 4 April 6th 06 08:53 PM
Partial String Match & Wild Cards Using VLOOKUP djDaemon Excel Worksheet Functions 0 March 9th 06 05:49 PM
Vlookup Question Jeff Excel Discussion (Misc queries) 2 December 2nd 04 02:40 PM
Find a match that;s not exact Phyllis Excel Worksheet Functions 0 November 8th 04 08:12 PM
Vlookup, Index & Match Phyllis Excel Worksheet Functions 1 November 8th 04 06:11 PM


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