Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculate a date based on period and year | Excel Worksheet Functions | |||
conditional formulas based on a time period | Excel Worksheet Functions | |||
how do I set up a validation rules with two data rules | Excel Worksheet Functions | |||
Sum column based on value in each row, if two cells equal, or if date is within time period | Excel Worksheet Functions | |||
assign value for period of time | Excel Discussion (Misc queries) |