View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default [newbie] first day of week

Hi Jon,

I suggest that you set up the following as a test in a new workbook and see
if it returns the info that you want.

Assume the following:-

Cell A2 contains the date Jan 1 2009

Cell B2 contains any date in 2009.

Cell C2 contains the following formula to calculate the week number with Mon
as the first day of the week:
=WEEKNUM(B2,2)

Cell D2 contains the following formula to calculate date of 1st day of week
number:-
=(C2-1)*7+$A$2-WEEKDAY($A$2)+2

Cell E2 contains the following formula to calculate date of last day of week
number:-
=(C2-1)*7+$A$2-WEEKDAY($A$2)+8

Note that I have made A2 in the formula absolute with the $ signs. this will
allow you to insert Jan 1 2009 in A2 then insert the other formulas in B2,
C2, D2 and E2 and then Autofill (drag) the formulas in those cells down and
you will be able to view the results for other dates.

I suggest that you format all DATE columns as ddd mmm dd yyyy so that you
can view the days of the week with the dates. Column C needs to be formatted
as a number so you can see the week number.

Someone else might be able to simplify the formula for you but it appears to
return the correct results under test.

--
Regards,

OssieMac


"Jon" wrote:

1. I would like to return the first calendar day of a week number and the
last calendar day of a week number, any ideas?

For example, I have week numbers 11 and 12 and I would like to return

- the first Monday of week 11
- the last Sunday of week 12

2. Any idea if it is possible to keep a 'table' of holidays for working days?