#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Vlookup question

I have a worksheet with an array of scheduled delivery dates, amounts, etc.
On another worksheet, I have a summary where there is a vlookup for the
delivery date. The problem is that if it is not on the same day, it will
return the last date rather than the next date. Can excel look for the next
date?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,081
Default Vlookup question

use Match() with a -1 for the 3rd argument

From the help file for MATCH()

MATCH(lookup_value, lookup_array, [match_type])

[match_type]
1 or omitted
MATCH finds the largest value that is less than or equal to lookup_value.
The values in the lookup_array argument must be placed in ascending order,
for example: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE.

0
MATCH finds the first value that is exactly equal to lookup_value. The
values in the lookup_array argument can be in any order.

-1
MATCH finds the smallest value that is greater than or equal to
lookup_value. The values in the lookup_array argument must be placed in
descending order, for example: TRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ..., and
so on.


"Desperate" wrote:

I have a worksheet with an array of scheduled delivery dates, amounts, etc.
On another worksheet, I have a summary where there is a vlookup for the
delivery date. The problem is that if it is not on the same day, it will
return the last date rather than the next date. Can excel look for the next
date?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Vlookup question

Match just returns the cell number in the array, and not the cell value
itself? I can't get it to work. For example, if the dates are (Jan-21, the
Oct-20) in the array, and todays date is Aug-14 (lookup value) how can I get
the cell to return Oct-20 for next delivery date. If I use the vlookup it
will return Jan-21 everytime.

"Duke Carey" wrote:

use Match() with a -1 for the 3rd argument

From the help file for MATCH()

MATCH(lookup_value, lookup_array, [match_type])

[match_type]
1 or omitted
MATCH finds the largest value that is less than or equal to lookup_value.
The values in the lookup_array argument must be placed in ascending order,
for example: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE.

0
MATCH finds the first value that is exactly equal to lookup_value. The
values in the lookup_array argument can be in any order.

-1
MATCH finds the smallest value that is greater than or equal to
lookup_value. The values in the lookup_array argument must be placed in
descending order, for example: TRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ..., and
so on.


"Desperate" wrote:

I have a worksheet with an array of scheduled delivery dates, amounts, etc.
On another worksheet, I have a summary where there is a vlookup for the
delivery date. The problem is that if it is not on the same day, it will
return the last date rather than the next date. Can excel look for the next
date?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,081
Default Vlookup question

OK, I short-changed you on the answer. You need to use the Match() inside an
INDEX function. Index will return the value that is x number of rows down in
a range. The MATCH() function supplies the x value. So...

=INDEX($B$1:$B$18,MATCH(D1,$A$1:$A$18,-1))

will find the value in column B that corresponds to the date in A1:A18 that
EQUALS or is Later than the date in D1. Assumes that the dates in A1:A18 are
sorted in descending order.

"Desperate" wrote:

Match just returns the cell number in the array, and not the cell value
itself? I can't get it to work. For example, if the dates are (Jan-21, the
Oct-20) in the array, and todays date is Aug-14 (lookup value) how can I get
the cell to return Oct-20 for next delivery date. If I use the vlookup it
will return Jan-21 everytime.

"Duke Carey" wrote:

use Match() with a -1 for the 3rd argument

From the help file for MATCH()

MATCH(lookup_value, lookup_array, [match_type])

[match_type]
1 or omitted
MATCH finds the largest value that is less than or equal to lookup_value.
The values in the lookup_array argument must be placed in ascending order,
for example: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE.

0
MATCH finds the first value that is exactly equal to lookup_value. The
values in the lookup_array argument can be in any order.

-1
MATCH finds the smallest value that is greater than or equal to
lookup_value. The values in the lookup_array argument must be placed in
descending order, for example: TRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ..., and
so on.


"Desperate" wrote:

I have a worksheet with an array of scheduled delivery dates, amounts, etc.
On another worksheet, I have a summary where there is a vlookup for the
delivery date. The problem is that if it is not on the same day, it will
return the last date rather than the next date. Can excel look for the next
date?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Vlookup question

This works but isn't there a way to keep the dates in ascending order. It
just seems odd to be adding dates to the top of the list rather than the
bottom.

"Duke Carey" wrote:

OK, I short-changed you on the answer. You need to use the Match() inside an
INDEX function. Index will return the value that is x number of rows down in
a range. The MATCH() function supplies the x value. So...

=INDEX($B$1:$B$18,MATCH(D1,$A$1:$A$18,-1))

will find the value in column B that corresponds to the date in A1:A18 that
EQUALS or is Later than the date in D1. Assumes that the dates in A1:A18 are
sorted in descending order.

"Desperate" wrote:

Match just returns the cell number in the array, and not the cell value
itself? I can't get it to work. For example, if the dates are (Jan-21, the
Oct-20) in the array, and todays date is Aug-14 (lookup value) how can I get
the cell to return Oct-20 for next delivery date. If I use the vlookup it
will return Jan-21 everytime.

"Duke Carey" wrote:

use Match() with a -1 for the 3rd argument

From the help file for MATCH()

MATCH(lookup_value, lookup_array, [match_type])

[match_type]
1 or omitted
MATCH finds the largest value that is less than or equal to lookup_value.
The values in the lookup_array argument must be placed in ascending order,
for example: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE.

0
MATCH finds the first value that is exactly equal to lookup_value. The
values in the lookup_array argument can be in any order.

-1
MATCH finds the smallest value that is greater than or equal to
lookup_value. The values in the lookup_array argument must be placed in
descending order, for example: TRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ..., and
so on.


"Desperate" wrote:

I have a worksheet with an array of scheduled delivery dates, amounts, etc.
On another worksheet, I have a summary where there is a vlookup for the
delivery date. The problem is that if it is not on the same day, it will
return the last date rather than the next date. Can excel look for the next
date?

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 Eugen Excel Discussion (Misc queries) 2 August 7th 08 04:11 PM
vlookup question SteveDB1 Excel Worksheet Functions 2 September 27th 07 07:09 PM
=vlookup question scott Excel Discussion (Misc queries) 0 June 8th 06 06:14 PM
VLOOKUP Question mllestecchino Excel Worksheet Functions 4 April 6th 06 08:53 PM
VLOOKUP question Tom Weston Excel Discussion (Misc queries) 2 February 10th 06 06:44 PM


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