Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PAR PAR is offline
external usenet poster
 
Posts: 20
Default DateRange Lookup no exact match, can't use lesser

want to lookup up the date value entered in cells C15 through C22

Lookup table = $C $6 through $D $11 and return value in column 2

Problem - dates in C15 through C22 are date ranges. Formula must return the
date in column D of the lookup table_array which corresponds to the date in
cells $C$6 through $C$11 that is =C15 and <= C 15

So if table looks like this

c6 = 1/1/2010 d6 = 1/12/2010
c7 = 1/15/2010 d7 = 1/29/2010
c8 = 1/31/2010 d8 = 2/13/2010
c9 = 2/15/2010 d9 = 2/26/2010
c10 = 2/28/2010 d10 = 3/13/2010
c11 = 3/15/2010 d11 = 3/29/2010

and date is entered in c ; formula in d returns
c15 = 1/31/2010 d15 = 2/13/2010
c16 = 1/19/2010 d16 = 2/13/2010

because 1/19/2010 is greater than 01/15/2010, but less than 01/31/2010.

(Columns A through F are all populated with dates.)

I have tried many formulas, using combinations of Vlookup, lookup, and match
(even inverting the lookup array table to accomodate match using -1. This
caused issues with other formulas).






  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default DateRange Lookup no exact match, can't use lesser

Hi,

The easiest would be to sort column C in descending order and then use this

=INDEX($d$6:$d$11,MATCH(C15,$c$6:$c$11,-1),1)

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"PAR" wrote in message
...
want to lookup up the date value entered in cells C15 through C22

Lookup table = $C $6 through $D $11 and return value in column 2

Problem - dates in C15 through C22 are date ranges. Formula must return
the
date in column D of the lookup table_array which corresponds to the date
in
cells $C$6 through $C$11 that is =C15 and <= C 15

So if table looks like this

c6 = 1/1/2010 d6 = 1/12/2010
c7 = 1/15/2010 d7 = 1/29/2010
c8 = 1/31/2010 d8 = 2/13/2010
c9 = 2/15/2010 d9 = 2/26/2010
c10 = 2/28/2010 d10 = 3/13/2010
c11 = 3/15/2010 d11 = 3/29/2010

and date is entered in c ; formula in d returns
c15 = 1/31/2010 d15 = 2/13/2010
c16 = 1/19/2010 d16 = 2/13/2010

because 1/19/2010 is greater than 01/15/2010, but less than 01/31/2010.

(Columns A through F are all populated with dates.)

I have tried many formulas, using combinations of Vlookup, lookup, and
match
(even inverting the lookup array table to accomodate match using -1. This
caused issues with other formulas).






  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default DateRange Lookup no exact match, can't use lesser

Hi,

If you do not want to sort in descending order as suggested earlier, then
try this

=INDEX($D$6:$D$11,IF(ISERROR(MATCH(C15,$C$6:$C$11, 0)),MATCH(TRUE,INDEX((C15-$C$6:$C$11)<0,,1),0),MATCH(C15,$C$6:$C$11,0)),1)

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"PAR" wrote in message
...
want to lookup up the date value entered in cells C15 through C22

Lookup table = $C $6 through $D $11 and return value in column 2

Problem - dates in C15 through C22 are date ranges. Formula must return
the
date in column D of the lookup table_array which corresponds to the date
in
cells $C$6 through $C$11 that is =C15 and <= C 15

So if table looks like this

c6 = 1/1/2010 d6 = 1/12/2010
c7 = 1/15/2010 d7 = 1/29/2010
c8 = 1/31/2010 d8 = 2/13/2010
c9 = 2/15/2010 d9 = 2/26/2010
c10 = 2/28/2010 d10 = 3/13/2010
c11 = 3/15/2010 d11 = 3/29/2010

and date is entered in c ; formula in d returns
c15 = 1/31/2010 d15 = 2/13/2010
c16 = 1/19/2010 d16 = 2/13/2010

because 1/19/2010 is greater than 01/15/2010, but less than 01/31/2010.

(Columns A through F are all populated with dates.)

I have tried many formulas, using combinations of Vlookup, lookup, and
match
(even inverting the lookup array table to accomodate match using -1. This
caused issues with other formulas).






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rcs rcs is offline
external usenet poster
 
Posts: 1
Default DateRange Lookup no exact match, can't use lesser

Can you please explain how this formula works?

"Ashish Mathur" wrote:

Hi,

If you do not want to sort in descending order as suggested earlier, then
try this

=INDEX($D$6:$D$11,IF(ISERROR(MATCH(C15,$C$6:$C$11, 0)),MATCH(TRUE,INDEX((C15-$C$6:$C$11)<0,,1),0),MATCH(C15,$C$6:$C$11,0)),1)

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"PAR" wrote in message
...
want to lookup up the date value entered in cells C15 through C22

Lookup table = $C $6 through $D $11 and return value in column 2

Problem - dates in C15 through C22 are date ranges. Formula must return
the
date in column D of the lookup table_array which corresponds to the date
in
cells $C$6 through $C$11 that is =C15 and <= C 15

So if table looks like this

c6 = 1/1/2010 d6 = 1/12/2010
c7 = 1/15/2010 d7 = 1/29/2010
c8 = 1/31/2010 d8 = 2/13/2010
c9 = 2/15/2010 d9 = 2/26/2010
c10 = 2/28/2010 d10 = 3/13/2010
c11 = 3/15/2010 d11 = 3/29/2010

and date is entered in c ; formula in d returns
c15 = 1/31/2010 d15 = 2/13/2010
c16 = 1/19/2010 d16 = 2/13/2010

because 1/19/2010 is greater than 01/15/2010, but less than 01/31/2010.

(Columns A through F are all populated with dates.)

I have tried many formulas, using combinations of Vlookup, lookup, and
match
(even inverting the lookup array table to accomodate match using -1. This
caused issues with other formulas).






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default DateRange Lookup no exact match, can't use lesser

As long as the lookup date will not be before the min date in the lookup
table or after the max date in the lookup table...

=INDEX(D$6:D$11,MATCH(C15,C$6:C$11)+(COUNTIF(C$6:C $11,C15)=0))

--
Biff
Microsoft Excel MVP


"PAR" wrote in message
...
want to lookup up the date value entered in cells C15 through C22

Lookup table = $C $6 through $D $11 and return value in column 2

Problem - dates in C15 through C22 are date ranges. Formula must return
the
date in column D of the lookup table_array which corresponds to the date
in
cells $C$6 through $C$11 that is =C15 and <= C 15

So if table looks like this

c6 = 1/1/2010 d6 = 1/12/2010
c7 = 1/15/2010 d7 = 1/29/2010
c8 = 1/31/2010 d8 = 2/13/2010
c9 = 2/15/2010 d9 = 2/26/2010
c10 = 2/28/2010 d10 = 3/13/2010
c11 = 3/15/2010 d11 = 3/29/2010

and date is entered in c ; formula in d returns
c15 = 1/31/2010 d15 = 2/13/2010
c16 = 1/19/2010 d16 = 2/13/2010

because 1/19/2010 is greater than 01/15/2010, but less than 01/31/2010.

(Columns A through F are all populated with dates.)

I have tried many formulas, using combinations of Vlookup, lookup, and
match
(even inverting the lookup array table to accomodate match using -1. This
caused issues with other formulas).










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
How to get exact match with LOOKUP function? s51janez Excel Worksheet Functions 1 October 2nd 08 01:21 PM
Vlookup- Closest match that contains the exact lookup value? Muthanna Excel Worksheet Functions 0 June 18th 08 03:15 PM
Lookup Exact Match Keep It Simple Stupid Excel Worksheet Functions 8 February 20th 08 07:31 PM
Lookup and Match with not exact numbers Jon Dow Excel Worksheet Functions 3 February 23rd 07 03:54 AM
Match - Exact - Lookup? Danny Excel Worksheet Functions 5 April 27th 06 10:04 PM


All times are GMT +1. The time now is 04:07 AM.

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"