How to Create Week Number and Year Fields in Microsoft Project
Question details
The user needs to extract and display the week number and year from task dates to group tasks properly in project views and reports.

- Product
- Microsoft Project
- Device & OS
- not provided
- Scenario
- Grouping tasks and resources within a rolling three-week window (previous, current, and future) for views and reports.
- Observed behavior
- Standard date formatting does not support grouping tasks into rolling weekly periods, requiring a custom formula in a text field instead.
Ensure you have the correct administrative or project permissions to create and edit custom fields in Project Professional or Project Web App (PWA).
Use a Calculated Custom Text Field
Create a custom text field with a formula to extract the week number and year from the task's Start or Finish date.
By using a calculated formula instead of basic date formatting, Microsoft Project treats the result as a distinct text string, allowing you to accurately group tasks and resources into weekly windows.
Open your project in Microsoft Project, go to the 'Project' tab on the ribbon, and click on 'Custom Fields'.
In the Custom Fields dialog box, select 'Task' and change the type to 'Text' from the dropdown. Choose an available text field (e.g., Text1).
In the 'Custom attributes' section, select the 'Formula' radio button and click the 'Formula...' button. Enter the following formula for the Start date: CStr("Week #" & DatePart("ww", [Start]) & " " & Year([Start])).
Click 'OK' to save the formula. You can now insert this custom text field into your task views and use it to group tasks by week number and year.

Manage Project Timelines Easily with WPS Office
Since custom field formulas for PWA are unique to Microsoft Project, you can alternatively manage task timelines, calculate weekly schedules, and create Gantt charts using WPS Spreadsheet, a free and lightweight alternative with full Excel formula compatibility.

Frequently Asked Questions
Can I use standard date formatting to achieve rolling week groups?
No. While standard date formatting changes the visual display of a date, it does not reliably group tasks into rolling periods like previous, current, and future weeks. A calculated custom field is necessary for this functionality.
What if my project week starts on a Monday instead of Sunday?
You can modify the DatePart function in your formula by adding the optional firstdayofweek argument. For example, adding vbMonday (or the numeral 2) tells the function to calculate weeks starting on a Monday.
Can I calculate the week number based on the task's Finish date?
Yes. Simply replace the [Start] field with [Finish] in the formula (i.e., CStr("Week #" & DatePart("ww", [Finish]) & " " & Year([Finish]))) to generate the text string based on the task's estimated or actual finish date.




