Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Array Lookup to Find Closest Date and Next Closest Date

Googled all over and haven't been able to find a solution- thanks in
advance for any help!

In Col A I have a list of items that are due for arrival; in Col B I
have the corresponding arrival dates. List must remain unsorted
(sorted would be too easy!)

Col A Col B

Monkey 12/1/07
Cat 1/15/08
Cow 11/21/07
Monkey 11/18/07
Peanut 1/30/08
Monkey 12/24/07
Cow 11/14/07

In Col C I need a formula to drag down that will give the earliest
date available, so for Monkey the date 11/18/07 would fill in for
every instance of Monkey; Cow would get 11/14/07.

Is it possible to set column D with a formula that would give the
next< possible available date? So for Monkey, the answer would be

12/1/07?

Thanks again!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Array Lookup to Find Closest Date and Next Closest Date

You don't need any formulas. Put a header cell on top of both column. Then
setup a pivot with animal in the row area and min of date in the data area.
You should get:

Min of date
animal Total
Cat 1/15/2008
Cow 11/14/2007
Monkey 11/18/2007
Peanut 1/30/2008

for your sample data
--
Gary''s Student - gsnu2007a


" wrote:

Googled all over and haven't been able to find a solution- thanks in
advance for any help!

In Col A I have a list of items that are due for arrival; in Col B I
have the corresponding arrival dates. List must remain unsorted
(sorted would be too easy!)

Col A Col B

Monkey 12/1/07
Cat 1/15/08
Cow 11/21/07
Monkey 11/18/07
Peanut 1/30/08
Monkey 12/24/07
Cow 11/14/07

In Col C I need a formula to drag down that will give the earliest
date available, so for Monkey the date 11/18/07 would fill in for
every instance of Monkey; Cow would get 11/14/07.

Is it possible to set column D with a formula that would give the
next< possible available date? So for Monkey, the answer would be

12/1/07?

Thanks again!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Array Lookup to Find Closest Date and Next Closest Date

Try in C1, array-entered with CTRL+SHIFT+ENTER:
=INDEX($B$1:$B$100,MATCH(SMALL(IF($A$1:$A$100=$A1, $B$1:$B$100),COLUMNS($A:A)),IF($A$1:$A$100=$A1,$B$ 1:$B$100),0))
Copy C1 to D1, fill down. Adapt the ranges to suit.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
wrote in message
oups.com...
Googled all over and haven't been able to find a solution- thanks in
advance for any help!

In Col A I have a list of items that are due for arrival; in Col B I
have the corresponding arrival dates. List must remain unsorted
(sorted would be too easy!)

Col A Col B

Monkey 12/1/07
Cat 1/15/08
Cow 11/21/07
Monkey 11/18/07
Peanut 1/30/08
Monkey 12/24/07
Cow 11/14/07

In Col C I need a formula to drag down that will give the earliest
date available, so for Monkey the date 11/18/07 would fill in for
every instance of Monkey; Cow would get 11/14/07.

Is it possible to set column D with a formula that would give the
next< possible available date? So for Monkey, the answer would be

12/1/07?

Thanks again!



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

Format cols C and D as dates
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Array Lookup to Find Closest Date and Next Closest Date

How about this array formula:

=MIN(IF(A$1:A$100=A1,B$1:B$100))

--
Gary''s Student - gsnu2007


"Max" wrote:

Try in C1, array-entered with CTRL+SHIFT+ENTER:
=INDEX($B$1:$B$100,MATCH(SMALL(IF($A$1:$A$100=$A1, $B$1:$B$100),COLUMNS($A:A)),IF($A$1:$A$100=$A1,$B$ 1:$B$100),0))
Copy C1 to D1, fill down. Adapt the ranges to suit.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
wrote in message
oups.com...
Googled all over and haven't been able to find a solution- thanks in
advance for any help!

In Col A I have a list of items that are due for arrival; in Col B I
have the corresponding arrival dates. List must remain unsorted
(sorted would be too easy!)

Col A Col B

Monkey 12/1/07
Cat 1/15/08
Cow 11/21/07
Monkey 11/18/07
Peanut 1/30/08
Monkey 12/24/07
Cow 11/14/07

In Col C I need a formula to drag down that will give the earliest
date available, so for Monkey the date 11/18/07 would fill in for
every instance of Monkey; Cow would get 11/14/07.

Is it possible to set column D with a formula that would give the
next< possible available date? So for Monkey, the answer would be

12/1/07?

Thanks again!






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Array Lookup to Find Closest Date and Next Closest Date

On Nov 6, 11:08 am, Gary''s Student
wrote:
How about this array formula:

=MIN(IF(A$1:A$100=A1,B$1:B$100))

--
Gary''s Student - gsnu2007

"Max" wrote:
Try in C1, array-entered with CTRL+SHIFT+ENTER:
=INDEX($B$1:$B$100,MATCH(SMALL(IF($A$1:$A$100=$A1, $B$1:$B$100),COLUMNS($A:A)),IF($A$1:$A$100=$A1,$B$ 1:$B$100),0))
Copy C1 to D1, fill down. Adapt the ranges to suit.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
wrote in message
roups.com...
Googled all over and haven't been able to find a solution- thanks in
advance for any help!


In Col A I have a list of items that are due for arrival; in Col B I
have the corresponding arrival dates. List must remain unsorted
(sorted would be too easy!)


Col A Col B


Monkey 12/1/07
Cat 1/15/08
Cow 11/21/07
Monkey 11/18/07
Peanut 1/30/08
Monkey 12/24/07
Cow 11/14/07


In Col C I need a formula to drag down that will give the earliest
date available, so for Monkey the date 11/18/07 would fill in for
every instance of Monkey; Cow would get 11/14/07.


Is it possible to set column D with a formula that would give the
next< possible available date? So for Monkey, the answer would be
12/1/07?


Thanks again!


Thanks everyone!!!

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Array Lookup to Find Closest Date and Next Closest Date

Welcome. Think my earlier suggestion was overdone. No need for the
INDEX/MATCH. Just the SMALL part would suffice here.

In C1, array-entered with CTRL+SHIFT+ENTER:
=SMALL(IF($A$1:$A$100=$A1,$B$1:$B$100),COLUMNS($A: A))
Format C1 as date. Copy C1 to D1, fill down. Adapt the ranges to suit.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
wrote
Thanks everyone!!!



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Array Lookup to Find Closest Date and Next Closest Date

You didn't respond to your post from yesterday!

It's best to stick to a single thread concerning a single subject.

http://tinyurl.com/2xexre

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
wrote in message
oups.com...
On Nov 6, 11:08 am, Gary''s Student
wrote:
How about this array formula:

=MIN(IF(A$1:A$100=A1,B$1:B$100))

--
Gary''s Student - gsnu2007

"Max" wrote:
Try in C1, array-entered with CTRL+SHIFT+ENTER:
=INDEX($B$1:$B$100,MATCH(SMALL(IF($A$1:$A$100=$A1, $B$1:$B$100),COLUMNS($A:A)),IF($A$1:$A$100=$A1,$B$ 1:$B$100),0))
Copy C1 to D1, fill down. Adapt the ranges to suit.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
wrote in message
roups.com...
Googled all over and haven't been able to find a solution- thanks in
advance for any help!


In Col A I have a list of items that are due for arrival; in Col B I
have the corresponding arrival dates. List must remain unsorted
(sorted would be too easy!)


Col A Col B


Monkey 12/1/07
Cat 1/15/08
Cow 11/21/07
Monkey 11/18/07
Peanut 1/30/08
Monkey 12/24/07
Cow 11/14/07


In Col C I need a formula to drag down that will give the earliest
date available, so for Monkey the date 11/18/07 would fill in for
every instance of Monkey; Cow would get 11/14/07.


Is it possible to set column D with a formula that would give the
next< possible available date? So for Monkey, the answer would be
12/1/07?


Thanks again!


Thanks everyone!!!



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
Find closest future date from list ... Ray Excel Discussion (Misc queries) 3 September 20th 07 07:43 PM
Closest value lookup? ADK Excel Worksheet Functions 12 June 21st 07 09:13 PM
How can I match a calculated date to closest date from a list? David P Excel Worksheet Functions 2 January 22nd 07 12:05 PM
Lookup Closest Value chad Excel Worksheet Functions 3 September 29th 06 07:58 PM
finding a date/time in a list that is closest to an existing date/ Jamie Excel Discussion (Misc queries) 1 May 27th 06 08:54 PM


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