简体   繁体   中英

Excel Date Filter not grouping dates

I am pulling data from another spreadsheet and have a filter on the column header. The dates range from 2015 to 2018 off all months, weeks and days. Some of the dates are not grouping eg 15/03/2018 is loose underneath the 2018, 2017, 2016 and 2015 collapsible boxes.

All dates has come from the same source spreadsheet and the Marco formats them all as did/mm/yyyy when copying over.

I solved a similar problem by copying the column to notepad, and reinserting it. After this all dates were in the same format.

Make sure Excel recognizes the whole column as a set of dates.

Grouping requires all cells to be formatted as dates. Grouping will only work if there are no empty or text cells in a range and all cells have the same date format.

You may try the following steps to correct number format in the range:

  • remove any number formats (Home -> Clear -> Clear Formats...). After this step your date values shall look like numbers (eg 43284, 43285 etc.)
  • (optional) multiply the whole range by 1 (Copying "1" from a single cell and using "Paste Special"). This step effectively converts all cell formats to numeric
  • (optional) use filter to check if there are any empty / text cells left and fill them with numeric values (eg zeroes)
  • finally, apply the date format (Home -> Number -> Long Date)

I have found the formula DATE(YEAR(a1),MONTH(a1),DAY(a1)) will translate both strings that look like dates and actual dates into a date format.

Filtering and sorting behavior should then be consistent down the column.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM