none
Wrong week numbers RRS feed

  • Question

  • I am using MS Project Professional 2010

    I added a “Number” column and added the forumla:

    Format([Start];"ww")

    This is supposed to show me the week numbers when my tasks start. The problem is that it gives correct results for 2015, but wrong for 2016. For 2016 it actually is always one week more. Like this:

    7.12.2015 -> CW 50 (correct)

    4.1.2016 -> CW 2 (Wrong! Should be 1)

    13.05.2016 -> CW 20 (wrong! Should be 19!)

    Any idea why this happens and how I can solve it?

    Monday, January 4, 2016 9:38 AM

Answers

  • Hi,

    I assume you are sitting in Europe (and expect weeknumbers following ISO 8601). Please use "DatePart("ww";[Start];2;2)" The function Datepart gives the possibility to define first day of week (Monday = 2) and first week of a year (first week with 4 days within the same year = 2).

    Does that work?
    Barbara


    To increase the value of this forum, please mark the replies that helped to solve your issue as answer. If you find answers to questions from other forum participants to be helpful, please mark them as helpful. Your participation will help others to find an appropriate solution faster. Thanks for your support!


    Monday, January 4, 2016 9:46 AM
    Moderator

All replies

  • Hi,

    I assume you are sitting in Europe (and expect weeknumbers following ISO 8601). Please use "DatePart("ww";[Start];2;2)" The function Datepart gives the possibility to define first day of week (Monday = 2) and first week of a year (first week with 4 days within the same year = 2).

    Does that work?
    Barbara


    To increase the value of this forum, please mark the replies that helped to solve your issue as answer. If you find answers to questions from other forum participants to be helpful, please mark them as helpful. Your participation will help others to find an appropriate solution faster. Thanks for your support!


    Monday, January 4, 2016 9:46 AM
    Moderator
  • Yes, I am sitting in Europe. Your answer works. Thanks!
    • Edited by Werner2000 Monday, January 4, 2016 10:25 AM
    Monday, January 4, 2016 10:24 AM
  • Werner2000:

    Barbara has already provided the solution to your question. 

    I want to share some additional information on the week number calculations: 

    - You do not need to calculate the week numbers in MS Project. See how to do it here at: http://www.msptips.com/#Tip30

    - Here is a detailed article on how to use the DatePart and Format functions on the week number calculations in MS Project: http://www.msptips.com/Formulas/WN.html

    - Both the DatePart and the Format functions have a known bug. See the section Working with Dates and Times for the simple modification applied to the formulas to fix any inaccurate week number returned. In short, the formula can be fixed as follows (pjMonday returns 2):

    “W” & iif (  Val( Format( [Scheduled Start], “ww”, pjMonday, 2 )) > 52 AND
                        Val( Format( [Scheduled Start] + 7, “ww”, pjMonday, 2 )) = 2,
                        1, Format( [Scheduled Start], “ww”, pjMonday, 2 ) )



    Ismet Kocaman | Learn Formulas | Articles | Connect

    Monday, January 4, 2016 4:05 PM