Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Find That Date

Hi there,
Can you please help me to slove this problem.

I have two spreadsheets the first with a list of dates and other info.
And the second with a table like the one below.

Year/Period Month Start Period End Period
2004-01 April-2004 01-Apr-04 23-Apr-04
2004-02 May-2004 24-Apr-04 21-May-04
2004-03 June-2004 22-May-04 25-Jun-04
2004-04 July-2004 26-Jun-04 23-Jul-04

I want to look up the date in the first spreadseet to see if it falls
between the start and end period and bring me back the year/period.
Notice that the periods may have two months in it.

I cannot use a nested if statement because I have a number of years to
consider. I could use a maco to test each line but wanted to know if
there is a formular that I can use insead.

Thanks in advance
Denz
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default Find That Date

Assuming that the periods are sorted and contiguous, I would use

=INDEX(period_range,MATCH(date,start_range))

Since you posted to the programming newsgroup, you may want to do this
from VBA; use Application.INDEX, Application.MATCH, and range objects.

Jerry

Denz wrote:

Hi there,
Can you please help me to slove this problem.

I have two spreadsheets the first with a list of dates and other info.
And the second with a table like the one below.

Year/Period Month Start Period End Period
2004-01 April-2004 01-Apr-04 23-Apr-04
2004-02 May-2004 24-Apr-04 21-May-04
2004-03 June-2004 22-May-04 25-Jun-04
2004-04 July-2004 26-Jun-04 23-Jul-04

I want to look up the date in the first spreadseet to see if it falls
between the start and end period and bring me back the year/period.
Notice that the periods may have two months in it.

I cannot use a nested if statement because I have a number of years to
consider. I could use a maco to test each line but wanted to know if
there is a formular that I can use insead.

Thanks in advance
Denz


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 Specific date in Biwwekly Based on date jlclyde Excel Discussion (Misc queries) 3 January 27th 09 09:15 PM
Julian date - find next highest date/number jchick0909 Excel Worksheet Functions 1 March 20th 08 11:38 PM
Find the date of the coming up Saturday given the current date. Michael Ermino Excel Worksheet Functions 4 April 11th 07 02:48 AM
Need help to find a date (latest date) from a column CraigNowell Excel Worksheet Functions 4 March 20th 06 10:47 PM
Need help to find a date (latest date) from a column Max Excel Worksheet Functions 0 March 20th 06 02:49 PM


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