删除 Google 表格查询数据透视表中的标题行 [英] Removing header row in Google sheets query pivot

查看:30
本文介绍了删除 Google 表格查询数据透视表中的标题行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然删除 Google 表格查询函数中的标题行看起来很简单,但我没有看到任何关于在查询涉及数据透视时删除标题行的建议.作为参考,我提供了一个 电子表格的查看权限链接 复制了我正在使用的结构.

While removing the header row in a Google sheets query function seems straightforward, I don't see any suggestions on removing the header row when the query involves a pivot. For reference, I am giving a link with viewing rights to a spreadsheet which replicates the structure of the one I am working with.

查询位于选项卡查询表"的单元格 C4 中.内容如下:

The query is in cell C4 of the tab "Query sheet" and reads as follows:

= QUERY('Class hours'!A2:C11,"select sum(C) WHERE A='" & A5 & "' group by A pivot B")

目的是删除此工作表中单元格 C4:E4 中的行标题,以便可以将此函数复制到 C 列中,以包括 A 列中的所有名称以及行中的相应总和 (C).感谢您的关注.

The aim is to remove the row headers in cells C4:E4 in this sheet so that this function can be copied down column C to include all names in Column A with corresponding Sum (C) in the rows. Thanks for your attention.

推荐答案

试试这个:

=QUERY(QUERY('Class hours'!A2:C11,
 "select sum(C) 
  where A = '"&A5&"' 
  group by A 
  pivot B"), 
 "offset 1", 0)

甚至在你的情况下:

=INDEX(QUERY('Class hours'!A2:C11,
 "select sum(C) 
  where A = '"&A5&"' 
  group by A 
  pivot B"), 2)

这篇关于删除 Google 表格查询数据透视表中的标题行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆