简体   繁体   English

Google 表格查找 2 列和第 3 列的总和值

[英]Google Sheets lookup 2 columns and sum values of 3rd column

I'm trying to summarize some data.我正在尝试总结一些数据。 Each row has a Person's Name, Date, and Distance data.每行都有一个人的姓名、日期和距离数据。 For any date, a Person might have multiple rows, which I'm trying to combine by summing the distance of all activiites on that date.对于任何日期,一个人可能有多行,我试图通过对该日期所有活动的距离求和来合并这些行。

Data looks like this:数据如下所示:

Name姓名 Date日期 Distance距离
Person1人1 12/25/2022 12/25/2022 50 50
Person1人1 12/26/2022 12/26/2022 25 25
Person1人1 12/26/2022 12/26/2022 10 10
Person2人2 12/25/2022 12/25/2022 5 5个
Person2人2 12/26/2022 12/26/2022 10 10
Person2人2 12/27/2022 12/27/2022 30 30

Summary table add up the total distances for each day:汇总表将每天的总距离相加:

Name姓名 12/25/2022 12/25/2022 12/26/2022 12/26/2022 12/27/2022 12/27/2022
Person1人1 50 50 35 35 0 0
Person2人2 5 5个 10 10 30 30

I can't figure out how to build an array for Person/Date to sum for just that date.我无法弄清楚如何为 Person/Date 构建一个数组以仅对该日期求和。

Here's an example sheet where I've tried various vlookup, sumif and other methods but need can't isolate the name-date combo.这是一个示例表,我在其中尝试了各种 vlookup、sumif 和其他方法,但无法隔离名称-日期组合。

Here's an example sheet.这是一个示例表。 Thanks!谢谢!

https://docs.google.com/spreadsheets/d/1dQUlYD0gvLRm3n2JbEOxCw0JW7rDmKlvFsoyctjyans/edit?usp=sharing https://docs.google.com/spreadsheets/d/1dQUlYD0gvLRm3n2JbEOxCw0JW7rDmKlvFsoyctjyans/edit?usp=sharing

You can try with this QUERY:您可以尝试使用此查询:

=query(B:D,"Select B,SUM(D) where B is not null group by B pivot C",1)

在此处输入图像描述

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

相关问题 如何获取脚本以将2个变量的总和添加到表格中的第3列 - How to get a Script to add the sum of 2 variables to a 3rd column in Sheets 如何使用 2 列作为 X 和 Y 值和第 3 列在谷歌表格中分散 plot 以获得该点的颜色? - How to make scatter plot in google sheets using 2 columns as X and Y values and the 3rd columns to get color of that point? 查找两列之间的匹配项,将第三列相加。 - Find matches between two columns, sum 3rd column. Google表格查询和总和 - Google sheets lookup and sum 如何使用 Google 表格查找和求和 - How to lookup and sum with Google Sheets Google表格 - 动态查询总和 - Google Sheets - dynamic lookup sum Google表格公式可计算一列中的值之和,该值与另一张表中的多列匹配 - Google Sheets formula to calculate sum of values in one column which match multiple columns in another sheet 通过第三方链接将数据写入 Google 表格中的单元格 - Writing data to a cell in Google Sheets from a 3rd party link 在一列中查找值,如果匹配,则添加来自不同列的值 Google Script Google Sheets - Lookup Values in one column and if match add the values from a different column Google Script Google Sheets Google Sheets、Lookup 和 SUM 全部匹配 - Google Sheets, Lookup and SUM together all matching
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM