Cannot Group Dates in a Pivot Table – 4 Solutions

This is an overview:

Cannot Group Dates in Pivot Table


Solution 1 – Replacing Missing or Distorted Date Values to Group Dates in a Pivot Table

Step 1:

  • There are error date values in the image below:

Replace Missing or Distorted Date Values in Pivot Table

 

  • 3 error dates were corrected.

 

Corrected 3 Error Dates in Excel

Step 2:

  • To group dates, create a pivot table: drag the cells as shown below:

Drag the Cells Like the Image Below to Create a Pivot Table

This is the pivot table:

Pivot Table Created by Excel

Step 3:

  • Select any cell containing a year.
  • Right-click it.
  • Click Group.

Cannot Group Dates in Pivot Table

  • In Grouping, select how to group data. Here, Quarters and Years.
  • Click OK.

Select the Criteria to Group the Dates in Pivot Table

This is the output.

Pivot Table in Excel Grouped By Quarters and Years

Read More: [Fixed] Excel Pivot Table Not Grouping Dates by Month


Solution 2 – Filtering to Find Distorted Date Values and Group Dates in Pivot Tables

Step 1:

  • Select all the cells in the data range.
  • Click Filter in Data.

Select Filter Option Under the Data Tab

  • Click the small downward arrow on the right side of Ship Date: The filter drop-down menu has grouped all date values in this column by Year, and Date. Text and error date values are at the bottom of the list.

Filter the Error Date Values

Step 2:

  • To filter the Text and ERROR values, uncheck all the date items or uncheck Select All.
  • Select the text and error items.
  • Click OK.

Cannot Group Dates in Pivot Table

The column will be filtered and display the text and error values.

Filtered Dates that Contains Errors

Step 3:

Correct the filtered dates with errors:

Corrected Filter Dates in Excel

  • Click Filter again.

Click on the Filter Button Again

The data range will be displayed with corrected dates.

Cannot Group Dates in Pivot Table

  • Group the dates.

Solution 3 – Finding Error Date Values Using the GoTo Special Menu to Group Dates in the Pivot Table

Steps:

  • Select the entire column in the date field. You can press CTRL+SPACE.
  • Go to Find & Select in the Home tab.
  • Select Go To Special.

Select Go To Special Menu

  • Select Constants.
  • Uncheck Numbers.
  • Click OK.

GO To Special Menu in Excel

Cells containing text or error values will be selected.

  • You can highlight these cells to fix the values. Here, in Red.

Select Red Color to Highlight the Dates with Errors


Solution 4 – Finding Error Date Values using VBA

  • Click ALT+F11 to open Visual Basic You can also open it in the Developer tab.

Select VBA Basic From Developer Tab in Excel

  • Click Insert and select Module.

Select Error Date Values in Pivot Table With VBA

  • Use the following code:
Public Function CellType(c)
    Application.Volatile
    Select Case True
        Case IsEmpty(c): CellType = "Blank"
        Case Application.IsText(c): CellType = "Text"
        Case Application.IsLogical(c): CellType = "Logical"
        Case Application.IsErr(c): CellType = "Error"
        Case IsDate(c): CellType = "Date"
        Case InStr(1, c.Text, ":") <> 0: CellType = "Time"
        Case InStr(1, c.Text, "%") <> 0: CellType = "Percentage"
        Case IsNumeric(c): CellType = "Value"
    End Select
End Function
  • Click the File tab and save the Excel file.

Cannot Group Dates in Pivot Table

  • Go back to the source worksheet and enter the following function in G5:
=CellType(F5)

Write the Function CellType in the Cell

  • Press ENTER.

You will see the data type used in F5.

CellType Function Shows the Data Type of the Cell

  • Drag down the Fill Handle to see the result in the rest of the cells.

There is Text for dates with error values.

  • Highlight the cells with Text to correct them.

Things to Remember

  • You can also use the VBA CellType function to determine the type of data in a cell.
  • Select New Worksheet when you are creating a pivot table.

Download Practice Workbook

Download this practice book.


Related Articles


<< Go Back to Group Dates in Pivot Table | Group Pivot Table | Pivot Table in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
ASM Arman
ASM Arman

Abu Saleh Arman is a Marine engineer and Excel & VBA expert. He loves programming with VBA. He finds VBA programming a time-saving tool to manipulate data, handle files, and interact with the internet. He is very interested in Python, MATLAB, PHP, Deep Neural Networks, and Machine Learning, showcasing his diverse skill set. Arman holds a B.Sc in Naval Architecture & Marine Engineering from BUET, Bangladesh. However, he switched to a content developer, where he writes technical content... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo