[英]Excel/Google Sheets Transpose Column into Row Headers
I have a large amount of website page view data. 我有大量的网站页面浏览数据。 The exported format is:
导出的格式为:
Page | Date (mm/yy) | View Count
-----------------------------------
Page 1 | 01/18 | 150
Page 1 | 02/18 | 250
Page 1 | 03/18 | 350
Page 1 | 04/18 | 450
Page 2 | 01/18 | 150
Page 2 | 02/18 | 250
Page 2 | 03/18 | 350
Page 2 | 04/18 | 450
What I would like to do is format the data like this: 我想做的是像这样格式化数据:
Page | 01/18 | 02/18
-----------------------
Page 1 | 150 | 250
Page 2 | 150 | 250
Page 3 | 150 | 250
Page 4 | 150 | 250
What you're after can be done with a Pivot table with a few clicks. 只需单击几下即可通过数据透视表完成操作。
Best practice in Excel: Excel最佳做法:
With an Excel Table as the source, when you add more data to your source, you can simply click a cell in the pivot table and use Data > Refresh All to, well, refresh the pivot table. 使用Excel表作为源,当您向源中添加更多数据时,只需单击数据透视表中的单元格,然后使用“数据”>“全部刷新”即可刷新数据透视表。
Just a few clicks, no formulas. 只需单击几下,就没有公式。
=query({A:C}, "select Col1, sum(Col3) where Col3 is not null group by Col1 pivot Col2")
pivot
does what you wanted pivot
做什么你想要的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.