Not sure how it works but it looks to calculate the last Sunday prior to the
month entered.
For example:
=DATE(2005,9,1)-(WEEKDAY(DATE(2005,9,1))-1)+{0;1;2;3;4;5}*7+{1,2,3,4,5,6,7}-1
gives 28/08/2005 which is a Sunday
Regards
Trevor
"Á÷À˵ÄË«Óã" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> DATE(y,m,1)-(WEEKDAY(DATE(y,m,1))-1)+{0;1;2;3;4;5}*7+{1,2,3,4,5,6,7}-1
> I acquired the code from NG.
> But I can't understand it.
> Can anyone explain it for me?
> Thanks in advance.
> --
>
>
|