logo
search
Others

How to Create Week Number and Year Fields in Microsoft Project

Ayan MasoodAyan Masood Oct 21, 2026 868 views

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.

How to Create Week Number and Year Fields in Microsoft Project
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.
Before you start

Ensure you have the correct administrative or project permissions to create and edit custom fields in Project Professional or Project Web App (PWA).

Solution 1Recommended

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.

1
Open Custom Fields

Open your project in Microsoft Project, go to the 'Project' tab on the ribbon, and click on 'Custom Fields'.

2
Select a Text Field

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).

3
Enter the Formula

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])).

4
Save and Apply

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.

Use a Calculated Custom Text Field
Formula Calculation Defaults: By default, this formula uses Sunday as the first day of the week and January 1 as the first week of the year. You can replace [Start] with [Finish] if you need the calculation based on the finish date.
Free Microsoft Office alternative

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.

100% compatible with Microsoft Excel (.xlsx) formatsEasily calculate week numbers using the built-in WEEKNUM functionLightweight and fast alternative for project trackingRich library of free project management and Gantt chart templates
microsoft office alternative - wps office

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.