How to Convert an Excel Date to the Year Only for a Pivot Table
Question details
The user needs to display only the year from date data in an Excel Pivot Table. Formatting the source data to 'yyyy' does not update the grouping, and using the YEAR function returns incorrect results like 1905.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Grouping or filtering data by year within a Pivot Table based on a source date column.
- Observed behavior
- The Pivot Table continues to display months and years instead of just years. Adjusting the date format to 'yyyy' fails to change the grouping, and applying the YEAR function on certain values yields 1905 instead of the correct year.
Ensure your source data contains valid Excel date values rather than plain text strings, and clear any blank cells in the date column, as Pivot Tables rely on proper date serial numbers to group data accurately.
Use a Helper Column with the YEAR Function
Extract the year into a new column using the YEAR function to ensure the Pivot Table reads it as an independent numeric year value.
A Pivot Table reads the underlying value of a cell, not its display format. Changing the cell format to 'yyyy' only changes how it looks, not the actual date serial number. Creating a helper column provides the exact data the Pivot Table needs.
Insert a new column next to your source data and name the header 'Year'.
Assuming your first date is in cell A2, click cell B2 and type `=YEAR(A2)`, then press Enter. Drag the fill handle down to apply this formula to the rest of the column.
Select the new 'Year' column, right-click, select 'Format Cells', and change the format to 'General' to ensure it displays as a 4-digit number, not a date.
Go to your Pivot Table, click 'PivotTable Analyze' (or 'Options'), select 'Change Data Source' to include the new column, and drag the new 'Year' field into your Rows or Columns area.

Use the TEXT Function to Extract the Year
Convert the date into a text string that only displays the year, which bypasses date-serial errors if numeric sorting is not strictly required.
Convert Text Dates Using DATEVALUE
If your dates are stored as text rather than valid Excel dates, standard formulas will fail. Use DATEVALUE to fix the formatting before extracting the year.
Easily Manage Pivot Tables and Date Grouping in WPS Office
WPS Spreadsheet provides intuitive Pivot Table features, including automatic date grouping and robust formula support. You can effortlessly manage dates, extract years, and analyze your datasets without running into formatting errors.
- 1. Open your dataset: Launch WPS Spreadsheet and open your existing workbook containing the date values.
- 2. Use built-in grouping: Right-click a date directly inside your Pivot Table, select 'Group', and choose 'Years' to group without needing any formulas.
- 3. Apply helper formulas: If custom data extraction is needed, use standard formulas like =YEAR() or =TEXT() in a helper column, perfectly supported by WPS Spreadsheet.
- 4. Refresh and analyze: Click 'Refresh' on the Pivot Table menu to instantly apply your new year data for reporting.

Frequently Asked Questions
Why does changing the date format to 'yyyy' not change the Pivot Table grouping?
Changing the cell format only alters how the data is visually displayed, not the underlying value. The Pivot Table still pulls the full underlying date serial number (e.g., day, month, and year). To group by year, you must either use the Pivot Table's 'Group' feature or create a helper column.
Why does the YEAR function return 1905 instead of the correct year?
This happens if you apply the YEAR function to a cell that contains just the number '2015'. Excel interprets 2015 as a date serial number corresponding to July 8, 1905, so the YEAR function returns 1905. Ensure the source cell is a complete, full date.
Can I group dates by year directly in the Pivot Table without adding a new column?
Yes. Right-click any date inside your Pivot Table, select 'Group', and highlight 'Years' (while deselecting 'Months' and 'Quarters' if necessary). Note that this built-in grouping will fail if your source date column contains blank cells or dates stored as text.




