Need to find each day prior to first friday, monthly
Hi Paul,
| The line you typed, returned dates up to the first Wednesday.
Are you sure you've got the cell references correct? Unless you're using the 1904 date system, the formula
=A1<=INT(DATE(YEAR(A1),MONTH(A1)+0,1)/7+0)*7+6
will return 'TRUE' for all dates up to and including the 1st Friday. If you're using the 1904 date system, the formula still returns
'TRUE' for all dates up to and including the 1st Thursday.
| I don't understand the redundancies (i.e. (X/7)*7) or the "+0"
The INT(date/7)*7 tells Excel to take the first day of the month, then divide by 7, throw away the remainder, then multiply by 7
again. This finds the most recent Saturday on or before the date being tested. This is NOT a redundancy - you need it so that you
can calculate the following Friday. The '+0' bits can be deleted - I simply left them there in case you needed to vary either the
day or the month.
Cheers
--
macropod
[MVP - Microsoft Word]
"PaulRMcHanJr" wrote in message ...
| The line you typed, returned dates up to the first Wednesday. I changed the
| "+6" to "+8" and it works perfectly, but I have not been able to understand
| "how?" I would like an explaination of the solution, if it's not too much
| trouble. I don't understand the redundancies (i.e. (X/7)*7) or the "+0", but
| the formula doesn't work without them. Also, how does using "1" for the DAY
| affect the results? The "YEAR", "MONTH", and "DAY=1" are the same for all
| the cells in the month, but the results change.
| Confounded, but happy...
| --
| Thanks
|
|
| "macropod" wrote:
|
| Hi Paul,
|
| To find the 1st Friday of next month, try:
| =INT(DATE(YEAR(A1),MONTH(A1)+1,1)/7+0)*7+6
| Change the '+1' to get another month, the '+0' to get another week & the '+6' to get another day.
|
| To find out whether the date in A1 is within this month's grace period, try:
| =A1<=INT(DATE(YEAR(A1),MONTH(A1)+0,1)/7+0)*7+6
|
| Cheers
|
| --
| macropod
| [MVP - Microsoft Word]
|
|
| "PaulRMcHanJr" wrote in message ...
| | I am trying to create a calendar with a "grace period" that ends on the first
| | friday of each month.
| | I can identify the first friday:
| | =AND(WEEKDAY(A1)=6,DAY(A1)<=7)
| | and the first week:
| | =AND(DAY(A1)<=7)
| | but can't get my mind around selecting all the days of the month prior to
| | the first friday...
| | Thanks,
| | Paul
|
|
|
|