【问题标题】:Sum Values from a Column for unique values in a different column (Google Sheets)不同列中唯一值的总和值(谷歌表格)
【发布时间】:2023-03-20 16:22:01
【问题描述】:

我有一个保险客户数据集,其中同一个用户会出现多次。我想根据另一列中的唯一 ID 来总结一列。例如:

(column A (user_id), column B (total_paid))
(1, 5)
(2,10)
(3,15)
(4,20)
(5,10)
(5,10)
(5,10)
(6,12)
(6,12)
(6,12)

Total_paid = 72

现在想在 Google 表格中执行此操作,然后再将其转移到本机 SQL 中。思考 sumifs + countuniques,但到目前为止没有任何效果。

【问题讨论】:

    标签: google-sheets google-sheets-formula


    【解决方案1】:

    尝试:

    =QUERY(A:B; "select A,sum(B) where A is not null group by A label sum(B)''")
    

    【讨论】:

    • “数组结果未展开,因为它会覆盖公式所在的单元格中的数据”。我该如何解决? @player0
    • @DarShavit 这个公式需要两个空列来“推出”输出
    猜你喜欢
    • 2023-03-28
    • 1970-01-01
    • 1970-01-01
    • 2014-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多