Group Excel PivotTable Dates by Month and Year with Blank Cells
Question details
Group PivotTable data by month and year when the source date column contains blank or formula-generated empty cells.

- Product
- Microsoft Excel PivotTable
- Device & OS
- not provided
- Scenario
- A user wants to summarize a measure by month and year using a date column that contains empty cells.
- Observed behavior
- Blank cells or formulas returning empty strings can prevent Excel from grouping the date field.
Check the PivotTable source range and identify the date and measure columns. Confirm that populated dates are stored as Excel dates rather than text, and give any new helper columns distinct headers.
Add year and month helper columns to the source data
Use helper fields to summarize dates without relying on PivotTable date grouping.
In the source data, add columns named Year and Month next to the date column. If the source is not an Excel table, make sure these columns will be included in the PivotTable source range.
If the first date is in A2, enter =IF(ISNUMBER(A2),YEAR(A2),"") in the Year column and =IF(ISNUMBER(A2),MONTH(A2),"") in the Month column. Fill both formulas down through the source rows.
Click the PivotTable and use PivotTable Analyze > Change Data Source if needed to include the new columns. Then select PivotTable Analyze > Refresh.
In the PivotTable Fields pane, drag Month to Rows, Year to Columns, and the measure, such as Amount, to Values. Use the row or column filter to hide the blank item if you do not want undated records displayed.

Create a clean source and group the date field
Use Excel's built-in date grouping when you can create a source range containing only valid dates.
Build a Month-and-Year PivotTable in WPS Spreadsheets
Use year and month helper columns in WPS Spreadsheets, then arrange them in a PivotTable to summarize records with valid dates.
- 1. Open the source workbook: Open WPS Spreadsheets and select Open to load the workbook containing the date and measure columns.
- 2. Add helper columns: Add Year and Month headers. If the first date is in A2, enter =IF(ISNUMBER(A2),YEAR(A2),"") and =IF(ISNUMBER(A2),MONTH(A2),"") in the respective columns, then fill the formulas down.
- 3. Insert a PivotTable: Select the source data, including the helper columns, and choose Insert > PivotTable. Confirm the data range and choose where to place the PivotTable.
- 4. Set up the summary: In the PivotTable field list, drag Month to Rows, Year to Columns, and the measure field to Values. Use the field filters to hide blank items if needed.

Frequently Asked Questions
Why can't Excel group my PivotTable dates?
The source date field may contain blanks, text, errors, or formulas returning empty strings. Inspect the date column, or use Year and Month helper columns instead of grouping the date field.
How do I keep blank dates out of the PivotTable summary?
Open the Month or Year field filter in the PivotTable and clear the blank item. Undated records will then be excluded from the displayed summary.
Why are some dates missing from my helper columns?
The suggested formulas use ISNUMBER, so they leave the helper fields empty for text dates and errors. Convert valid text dates to Excel date values, fill the formulas down, and refresh the PivotTable.
How can I make the months appear in calendar order?
Use =IF(ISNUMBER(A2),MONTH(A2),"") for the Month helper column and sort the PivotTable row labels from smallest to largest. The resulting month numbers run from 1 through 12.




