Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Assign period to date based on rules.

I have a list of dates from 1/1/2005 all the way through 12/31/2008.
To this list I need to assign a period as follows:
- Every date in January 2005 up to the last Friday of the month will be
"Period 1"
- Every date immediately after the last Friday in January up until the last
Friday in February will be assigned "Period 2".
- This will continue all the way through the list.

I searched here and found a number of ways on how to identify the last
Friday of a month given a date.
This is the formula that I'm using.
{=MAX(IF(WEEKDAY(ROW(INDIRECT(A2&":"&EOMONTH(A2,0) )),2)=5,ROW(INDIRECT(A2&":"&EOMONTH(A2,0)))))}

If I have my list of dates on column A and insert this formula on column B
like so:

A B
1/1/2005 1/28/2005
1/2/2005 1/28/2005
..... ....
1/28/2008 1/28/2005
1/29/2005 1/0/1900
1/30/2005 1/0/1900
1/31/2005 1/0/1900
2/1/2005 2/25/2005

The formula will evaluate fine for all the dates in a month that are before
the last Friday of the month... but will revert to 1/0/1900 (serial number 0)
on the days in the month that fall after the last Friday of said month.
What I need is for those to go to the next period...
1/29/2005 would evaluate to 2/25/2005 and so on.

Is this possible?

Thanks.
Sebastian
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
Calculate a date based on period and year Sam Excel Worksheet Functions 5 August 27th 07 07:11 AM
conditional formulas based on a time period Lisa Excel Worksheet Functions 5 December 22nd 06 06:46 PM
how do I set up a validation rules with two data rules Trudy Excel Worksheet Functions 1 October 16th 06 05:42 AM
Sum column based on value in each row, if two cells equal, or if date is within time period [email protected] Excel Worksheet Functions 8 September 25th 06 02:40 PM
assign value for period of time AG Excel Discussion (Misc queries) 2 May 18th 05 01:32 PM


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