Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Find the three nearest dates

I have a table that contains names in b3:b19, and corresponding dates in
c3:c19. These dates are calculated, and change on a quarterly basis, and
there are often duplicate dates. The table is sorted by the names in column
B.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default Find the three nearest dates

Hi,
This may be too simple, but what about temporarily sorting the data by the
date column. That would give you the three names at the top of the names
list. Then sort again by name to restore the data as it was.
Otherwise:
If your three cells that display the upcoming dates are in C24:C26, then in
B24 enter:
=INDEX($B$3:$B$19,MATCH(C24,$C$3:$C$19,0))
and copy down.

Regards - Dave.
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Find the three nearest dates

Thanks, Dave, but I'm trying to put this pull this data into another file,
and would rather not sort the data.

As far as the formula you supplied, if I'm reading it right, it assumes that
I know what the next 3 dates are, but I don't. I just need the the next 3,
whatever they are.

Thanks, though, for your reply.

Mary
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default Find the three nearest dates

Sorry, I thought you knew the next three dates using =SMALL(C3:C19,{1;2;3}).
In this case, array entered into C24:C26
Regards - Dave
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Find the three nearest dates

I'm sorry, you were right! I wasn't thinking, I can use the array formula to
get the next three dates. But my problem is that the dates may repeat. For
example, the next 3 items on my list have the due dates of 6/21, 6/28 and
6/28. So I get the 2 names fine, but instead of getting the third name, I
get the second name again.

I'm confusing myself. Here's a simplified version:

Col A Col B
Anne 7/11
Barb 7/18
Carl 6/28
Doug 7/4
Enid 6/21
Fred 8/30
Greg 6/28

I need to get a list that says "Enid: 6/21, Carl: 6/28, Greg: 6:28".

(Not necessarily in that format, of course!)

When I used your formula, I get "Enid: 6/21, Carl: 6/28, Carl: 6:28".

Hope this is more clear, and I do thank you!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default Find the three nearest dates

Ah yes, I see that. Not sure how to proceed at present. With so many posts to
this thread, you may need to post again in a new one.
Regards - Dave.

"magdiego" wrote:

I'm sorry, you were right! I wasn't thinking, I can use the array formula to
get the next three dates. But my problem is that the dates may repeat. For
example, the next 3 items on my list have the due dates of 6/21, 6/28 and
6/28. So I get the 2 names fine, but instead of getting the third name, I
get the second name again.

I'm confusing myself. Here's a simplified version:

Col A Col B
Anne 7/11
Barb 7/18
Carl 6/28
Doug 7/4
Enid 6/21
Fred 8/30
Greg 6/28

I need to get a list that says "Enid: 6/21, Carl: 6/28, Greg: 6:28".

(Not necessarily in that format, of course!)

When I used your formula, I get "Enid: 6/21, Carl: 6/28, Carl: 6:28".

Hope this is more clear, and I do thank you!

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default Find the three nearest dates

Hi, I've been thinking - yeah, I know...

In each of three cells, enter:
=INDEX($B$3:$B$19,MATCH(SMALL($C$3:$C$19,1),$C$3:$ C$19,0))
=INDEX($B$3:$B$19,MATCH(SMALL($C$3:$C$19,2),$C$3:$ C$19,0))
=INDEX($B$3:$B$19,MATCH(SMALL($C$3:$C$19,3),$C$3:$ C$19,0))

It seemed to work when I tested it.

Regards - Dave.
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Find the three nearest dates

This works - THANKS!

Mary
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Find the three nearest dates

You're welocme. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"magdiego" wrote in message
...
This works - THANKS!

Mary



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 the nearest Christmas to a date lbbeurmann Excel Worksheet Functions 1 March 16th 07 03:48 PM
Find nearest value Two-Canucks Excel Discussion (Misc queries) 7 May 19th 06 07:49 PM
find nearest help nobbyknownowt Excel Worksheet Functions 5 April 21st 06 07:54 AM
use vlookup or other to find the nearest values (<) or interpola Rodney Excel Worksheet Functions 4 April 5th 06 09:21 PM
How do I select the nearest date from a ranges of dates? gerrit Excel Discussion (Misc queries) 3 February 12th 06 04:45 PM


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