简体   繁体   English

Excel 2013 数据透视过滤器不分组日期

[英]Excel 2013 pivot filter not grouping dates

I'm having the following issue using Excel 2013:我在使用 Excel 2013 时遇到以下问题:

My source data is organized as a table.我的源数据被组织成一个表格。 I have a date column titled E-Mail-Datum , formatted as date in dd.mm.yyyy .我有一个名为E-Mail-Datum的日期列,格式为dd.mm.yyyy日期。

Applying the regular filter directly to the source data table nicely groups the dates together as expected, such that one needs to expand year and month within the filter overlay in order to choose a specific date.将常规过滤器直接应用于源数据表可以很好地将日期按预期组合在一起,这样就需要在过滤器叠加中扩展年和月以选择特定日期。

But when I create a pivot table on this source data table, I would expect the same when filtering for the same dd.mm.yyyy -formatted date column.但是当我在这个源数据表上创建一个数据透视表时,我希望在过滤相同的dd.mm.yyyy格式的日期列时也是如此。 This is not the case: The filter overlay shows every single date in a simple (pretty Long) list, not grouping by month/year at all.情况并非如此:过滤器覆盖在一个简单(相当长)的列表中显示每个日期,根本没有按月/年分组。

How can I get the pivot filter to group dates by year/month?如何让数据透视过滤器按年/月对日期进行分组?

I'm pretty sure that this is just the way it is...the Tables autofilter automatically groups those dates, but the PivotTable filter doesn't.我很确定这就是它的方式......表格自动过滤器会自动对这些日期进行分组,但数据透视表过滤器不会。 You can always use the Group Field option from the PivotTable Tools > Analyze tab to group by Year and Month, so that you have separate fields for both, if that helps.您始终可以使用“数据透视表工具”>“分析”选项卡中的“分组字段”选项来按年和月分组,以便在有帮助的情况下为两者设置单独的字段。

Here is a workaround, but not a fix,这是一种解决方法,但不是解决方法,
Create a new column called day and give it the formula创建一个名为 day 的新列并为其指定公式

  • =DAY([@Date]) (if you have created set the data as a table) =DAY([@Date])(如果你已经创建了将数据设置为表格)
  • =Day(A1) (if it is normal data) =Day(A1)(如果是正常数据)

Then use Day instead of Days in the pivot table If you don't know how to do this here are the instructions Drag Date down to columns Go to a date field in the pivot table --> right click --> group然后在数据透视表中使用 Day 而不是 Days 如果您不知道如何执行此操作,这里是说明将日期向下拖动到列转到数据透视表中的日期字段--> 右键单击​​--> 组

  1. Select Years, Month, Days选择年、月、日
  2. Drag Years and Month to the filter box将年和月拖到筛选框
  3. Drag Days out of the pivot table to the selection box将天从数据透视表拖到选择框
  4. Drag Day into the filter box replacing "Days" with "Day"将 Day 拖入筛选框,将“Days”替换为“Day”

I think I had a similar problem.我想我有类似的问题。 The date data looked good in the column, but was not being recognized as a date in the Pivot Table, so Date grouping (eg Month, Year) was not available.日期数据在列中看起来不错,但在数据透视表中未被识别为日期,因此日期分组(例如,月份、年份)不可用。 The solution for me was to change the Number Format to Text (in the main spreadsheet), then change it back to Date .我的解决方案是将Number Format更改为Text (在主电子表格中),然后将其更改回Date After that, Date grouping options were available.之后,日期分组选项可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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