Maybe
=IF(AND(WEEKDAY(date_cell)=7,MONTH(date_cell)<>MONTH(Date_cell+1)), ... for
the Sat and
=IF(AND(WEEKDAY(date_cell)=1,MONTH(date_cell-1)<>MONTH(Date_cell)), ... for
the Sun

Signature
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
> Hi,
>
[quoted text clipped - 12 lines]
> regards,
> newbie
newbie@gmail.com - 26 Sep 2007 08:51 GMT
> Maybe
>
[quoted text clipped - 33 lines]
>
> - Show quoted text -
Hi,
Thanks. How about coding using vba?
regards,
Newbie
Bob Phillips - 26 Sep 2007 09:26 GMT
Dim myDate As Date
Dim LastWeek As Boolean
Dim FirstWeek As Boolean
myDate = DateSerial(2007, 6, 30)
LastWeek = Weekday(myDate) = 7 And Month(myDate) <> Month(myDate + 1)
FirstWeek = Weekday(myDate) = 1 And Month(myDate - 1) <> Month(myDate +
1)
MsgBox "Date " & myDate & ": " & vbNewLine & _
vbTab & "Firstweek = " & FirstWeek & vbNewLine & _
vbTab & "Lastweek = " & LastWeek
myDate = DateSerial(2007, 7, 1)
LastWeek = Weekday(myDate) = 7 And Month(myDate) <> Month(myDate + 1)
FirstWeek = Weekday(myDate) = 1 And Month(myDate - 1) <> Month(myDate +
1)
MsgBox "Date " & myDate & ": " & vbNewLine & _
vbTab & "Firstweek = " & FirstWeek & vbNewLine & _
vbTab & "Lastweek = " & LastWeek
myDate = Date
LastWeek = Weekday(myDate) = 7 And Month(myDate) <> Month(myDate + 1)
FirstWeek = Weekday(myDate) = 1 And Month(myDate - 1) <> Month(myDate +
1)
MsgBox "Date " & myDate & ": " & vbNewLine & _
vbTab & "Firstweek = " & FirstWeek & vbNewLine & _
vbTab & "Lastweek = " & LastWeek

Signature
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
>> Maybe
>>
[quoted text clipped - 43 lines]
> regards,
> Newbie