+ Reply to Thread
Results 1 to 4 of 4

Weeknumber

  1. #1
    Registered User
    Join Date
    03-02-2004
    Posts
    10

    Question Weeknumber

    Is there any way of calculating the weeks number (1-52) for a series of dates IF you don't have the Analysis Toolpak VBA installed to use the =WEEKNUM formula???

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Quote Originally Posted by loscherland
    Is there any way of calculating the weeks number (1-52) for a series of dates IF you don't have the Analysis Toolpak VBA installed to use the =WEEKNUM formula???
    Try the following...

    Week beginning on Sunday:

    =MATCH(A1,DATE(2005,1,1)-WEEKDAY(DATE(2005,1,1),3)-1+(ROW(INDIRECT("1:53")))*7-7)

    Week beginning on Monday:

    =MATCH(A1,DATE(2005,1,1)-WEEKDAY(DATE(2005,1,1),3)+(ROW(INDIRECT("1:53")))*7-7)

    Both these formulas need to be confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

  3. #3
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Quote Originally Posted by Domenic
    Try the following...

    Week beginning on Sunday:

    =MATCH(A1,DATE(2005,1,1)-WEEKDAY(DATE(2005,1,1),3)-1+(ROW(INDIRECT("1:53")))*7-7)

    Week beginning on Monday:

    =MATCH(A1,DATE(2005,1,1)-WEEKDAY(DATE(2005,1,1),3)+(ROW(INDIRECT("1:53")))*7-7)

    Both these formulas need to be confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!
    Correction...

    Week beginning on Sunday:

    =MATCH(A1,IF(WEEKDAY(DATE(YEAR(A1),1,1),2)=7,DATE(YEAR(A1),1,1)+(ROW(INDIRECT("1:53")))*7-7,DATE(YEAR(A1),1,1)-WEEKDAY(DATE(YEAR(A1),1,1),3)-1+(ROW(INDIRECT("1:53")))*7-7))

    Week beginning on Monday:

    =MATCH(A1,DATE(YEAR(A1),1,1)-WEEKDAY(DATE(YEAR(A1),1,1),3)+(ROW(INDIRECT("1:53")))*7-7)

    ...where A1 contains the date of interest. Both formulas need to be confirmed with CONTROL+SHIFT+ENTER.

  4. #4
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Quote Originally Posted by Domenic
    Correction...

    Week beginning on Sunday:

    =MATCH(A1,IF(WEEKDAY(DATE(YEAR(A1),1,1),2)=7,DATE(YEAR(A1),1,1)+(ROW(INDIRECT("1:53")))*7-7,DATE(YEAR(A1),1,1)-WEEKDAY(DATE(YEAR(A1),1,1),3)-1+(ROW(INDIRECT("1:53")))*7-7))

    Week beginning on Monday:

    =MATCH(A1,DATE(YEAR(A1),1,1)-WEEKDAY(DATE(YEAR(A1),1,1),3)+(ROW(INDIRECT("1:53")))*7-7)

    ...where A1 contains the date of interest. Both formulas need to be confirmed with CONTROL+SHIFT+ENTER.
    FWIW, I've modified the first formula...

    =MATCH(A1,DATE(YEAR(A1),1,1)-IF(WEEKDAY(DATE(YEAR(A1),1,1),2)<7,WEEKDAY(DATE(YEAR(A1),1,1),3)+1)+(ROW(INDIRECT("1:53")))*7-7)

    ...confirmed with CONTROL+SHIFT+ENTER.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1