Computing.Net > Forums > Office Software > Select a date from a list of Date

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Select a date from a list of Date

Reply to Message Icon

Name: redgonzales
Date: March 9, 2009 at 02:40:19 Pacific
OS: Windows XP
Subcategory: Microsoft Office
Comment:

Hi,

I need help on excel WHat i really need is to get a Date on a list with a reference date. Below is my example.

A- B - C
April 19 - March 20 - ?
- April 30
- May 16

On the above example, the reference is the April 19, now on column C I need to have a result of April 30.
This should not be hard coded.

Please help me with this.

Thanks,
Red



Sponsored Link
Ads by Google

Response Number 1
Name: DerbyDad03
Date: March 9, 2009 at 05:47:48 Pacific
Reply:

I think we need some more detail.

What is the relationship between the reference date and the desired date?

There has to be something for Excel to calculate or lookup, etc. The desired result can't be something random that you just "want".


0

Response Number 2
Name: redgonzales
Date: March 10, 2009 at 19:28:31 Pacific
Reply:

The list on column C is the deadline of the exact day of payment. While the April 19 which is the reference date is the completion date of all collection.

Since the reference date and the exact day of payment cannot be move, we need to know when is the exact day of payment.

In short we need to search in column C the nearest succeeding date referencing to April 19.

I hope this one gives you a better idea of what we need.

Thanks,
Red


0

Response Number 3
Name: DerbyDad03
Date: March 11, 2009 at 06:07:19 Pacific
Reply:

I'm lost.

Please provide examples of input and outpur dates and we'll see what we can do.


0

Response Number 4
Name: redgonzales
Date: March 15, 2009 at 10:59:47 Pacific
Reply:

Im sorry if I'm making you confused.

Here's an example

My input is April 30.
Now I have to selct on the list of available date. Example list are April 29, May 2, May 23, August 5 and August 24
The condition is I need to get the nearest succeeding date. In this example the answer is May 2.

I hope this one would help.

Thank you very much.

-Red


0

Response Number 5
Name: DerbyDad03
Date: March 15, 2009 at 16:22:11 Pacific
Reply:

If you can sort your list of dates in descending order, which is required by the MATCH function if you want to find a value that is greater than the lookup_value, this should work:

Assume your descending list of dates is in A1:A4 and the date you want to look up is in C1.

=INDEX(A1:A4,MATCH(C1,A1:A4,-1),1)

If you can't sort your list of dates in descending order, you could create a descending list in another location using the LARGE function and then modify the formula above to search that list. (You could even hide this list if you want)

Let's say your dates in A1:A4 are in random or ascending order and the date you want to look up is in C1. In F1, put this formula and drag it down to F4:

=LARGE($A$1:$A$4,ROW())

This should create a descending list of your dates in F1:F4 which will get updated if you change the list in A1:A4. The ROW() function generates the k argument for the LARGE function. There are certainly many other ways to generate the k argument, including just typing it.

Now you can use this list by modifying my other formula:

=INDEX($F$1:$F$4,MATCH(C1,$F$1:$F$4,-1),1)

The only other option I can think of is a UDF written in VBA.

Hope that helps!


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Select a date from a list of Date

Generate a List of Text in Excel www.computing.net/answers/office/generate-a-list-of-text-in-excel/7102.html

Filtering a list using formula www.computing.net/answers/office/filtering-a-list-using-formula/6256.html

Getting a summary of words in Word www.computing.net/answers/office/getting-a-summary-of-words-in-word/2432.html