Calculating weeks
On Thu, 20 Oct 2011 01:47:22 -0700 (PDT), Steve wrote:
Hi
I'm hoping this is more straightforward than I'm making it.
What I want is a formula to look at cell A1 (month) and B1 (year), and
give me the first complete week (ending on a Monday) in that month,
and a second formula to give me the last complete week (ending on a
Monday) in that month. So:
A1 B1
November 2011
result: First 07.11.11; Last: 28.11.11
Any ideas would be greatly appreciated.
Alan
The problem is that your specifications are not clear.
Excel does not "give you" anything. In terms of your question, it can return a date or multiple dates.
If you are looking for it to return multiple dates, it can provide vertical or horizontal arrays, or fill in a sequence of cells in the same row or the same column.
In any event, a starting point for whatever you want would be to determine the date of the first and last Monday in a month.
The first Monday would be given by the formula:
=DATE(B1,A1,8)-WEEKDAY(DATE(B1,A1,1)-2)
and the last Monday by the formula:
=DATE(B1,A1+1,1)-WEEKDAY(DATE(B1,A1+1,1)-2)
What to do with these values depends on specifics you have not yet supplied.
|