Last Saturday of each month(check on Monday)
On Wed, 9 May 2007 18:24:04 +0800, "jimmy" wrote:
Hi all,
What formula or code can return a boolean value that I perform a check on
MONDAY to see if the coming Saturday is the last Saturday of this month?
Thanks
With ANY date in A1, the following will return TRUE if the NEXT Saturday is the
LAST Saturday in the month; otherwise it will return FALSE.
=AND((EOMONTH(A1,0)-WEEKDAY(EOMONTH(A1,0))-A1)<=7,
(EOMONTH(A1,0)-WEEKDAY(EOMONTH(A1,0))-A1)0)
If the EOMONTH function is not available, and returns the #NAME? error, install
and load the Analysis ToolPak add-in.
How?
On the Tools menu, click Add-Ins.
In the Add-Ins available list, select the Analysis ToolPak box, and then click
OK.
If necessary, follow the instructions in the setup program
If you do not want to add the ATP, then use this formula instead:
=AND((DATE(YEAR(A1),MONTH(A1)+1,0)-WEEKDAY(
DATE(YEAR(A1),MONTH(A1)+1,0))-A1)<=7,(DATE(
YEAR(A1),MONTH(A1)+1,0)-WEEKDAY(DATE(
YEAR(A1),MONTH(A1)+1,0))-A1)0)
--ron
|