Google Answers Logo
View Question
 
Q: Excel - matching a date within date ranges ( No Answer,   2 Comments )
Question  
Subject: Excel - matching a date within date ranges
Category: Computers > Software
Asked by: mykemyke-ga
List Price: $5.00
Posted: 15 Jul 2005 14:39 PDT
Expires: 17 Jul 2005 10:33 PDT
Question ID: 543970
I have a table like this:

ID #	1	        2	        3	        4
From	11/1/2001	11/1/2002	11/1/2003	11/1/2004
to	10/31/2002	10/31/2003	10/31/2004	10/31/2005

And I have a separate cell with a date, say 12/15/2002.

I want to have a cell formula that takes the table and this separate
cell as an input, and outputs the ID #.  For the sample date, 2.  For
11/15/2004, the output would be 4.

Preferable to not have a VB function.

Clarification of Question by mykemyke-ga on 17 Jul 2005 10:33 PDT
shockandawe - that's exactly what I came up with over the weekend -
perfect though!  I'm going to cancel the question, but is there a way
to pay you the amount or should I not worry about it?
Answer  
There is no answer at this time.

Comments  
Subject: Re: Excel - matching a date within date ranges
From: shockandawe-ga on 15 Jul 2005 17:55 PDT
 
Lets say your categories are in range B1:F1
And your from dates are in B2:F2

lets say the date in question is cell A5 
then this formula in any cell will do the trick.

match(A5,B1:F1,B2:F2)

notice it doesn't use the from date at all. This works because there
aren't any gaps between the intervals starting on your "to" dates. It
just finds the cell that is the closest date match without going over
-- price is right style-- then reports the corresponding category.

it gets trickier if there are gaps in the intervals.
Subject: Re: Excel - matching a date within date ranges
From: shockandawe-ga on 15 Jul 2005 17:56 PDT
 
I goofed that function should read

=match(A5,B2:F2,B1:F1)

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy