View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Last Saturday of each month(check on Monday)

ron: your equeation is wrong becaue you didn't consider there is 5 days from
Monday to Saturday.

If the end of the month is the 30th and is on Friday, then Monday would be
the 26th. The formula would need to be False. The previous Monday the 19th
would be True.

"Ron Rosenfeld" wrote:

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