sumif+索引/匹配

发布于 2025-02-08 12:12:10 字数 182 浏览 2 评论 0原文

本质上,我试图在A列中找到与右侧数组中分布的名称相对应的总和。以下是我要做的事情以及我现在的公式是什么。请让我知道如何修改我的公式或如何重组数据。 在此处输入图像描述

Essentially I am trying to find the sum in column A that corresponds to names distributed in the array to the right. Below is a picture of what I am trying to do and what my formula is as of now. Please let me know either how to modify my formula or how to restructure my data.
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

揽清风入怀 2025-02-15 12:12:10

使用:

=INDEX(TRANSPOSE(QUERY(SPLIT(FLATTEN(IF(B2:G14="",,B2:G14&"×"&A2:A14)), "×"), 
 "select Col1,sum(Col2) where Col2 is not null group by Col1 label sum(Col2)'Totals'")))

在此处输入图像描述“

use:

=INDEX(TRANSPOSE(QUERY(SPLIT(FLATTEN(IF(B2:G14="",,B2:G14&"×"&A2:A14)), "×"), 
 "select Col1,sum(Col2) where Col2 is not null group by Col1 label sum(Col2)'Totals'")))

enter image description here

-小熊_ 2025-02-15 12:12:10

这是我想出的一个公式可以完成此操作:

= sum($ a $ 2:$ 2:$ a $ 11,arrayformula(reggexMatch(arrayformula(arrayformula) ,“ formulatest”,$ b $ 2:$ b $ $ c $ 2:$ c $ $ $ $ d $ 2:$ d $ $ $ $ $ $ 2: ),b13))= true))

该公式应放置在name1的单元格中, totals ,然后在每个行中复制在每个行中姓名。应更改单元格引用以匹配您的工作表/需求。在定义持续列或包含名称的每个列之前,具有$的任何内容。最后一个单元格引用(b13)是对包含您要总计名称的单元格的引用。此答案的底部显示了一个示例的屏幕截图。

简单地说,此公式将每行的名称结合到一个字符串中(每行),搜索该组合字符串中的每个名称,如果有匹配,则将持续时间值过滤,然后总和该值。

希望这有所帮助!让我知道我应该进一步解释或更好地澄清。

Here is a formula I came up with that can accomplish this:

=sum(filter($A$2:$A$11, arrayformula(REGEXmatch(ARRAYFORMULA((IF(ROW($A$2:$A$11)=1,"formulaTest",$B$2:$B$11 & $C$2:$C$11 & $D$2:$D$11 & $E$2:$E$11 & $F$2:$F$11))),B13))=TRUE))

This formula should be placed in the cell below Name1, next to Totals, and then copied across the row under each name. The cell references should be changed to match your sheet/needs. Anything with $ before it defines either the duration column, or each column that contains the names. The last cell reference (B13) is a reference to the cell that contains the name you are looking to total. A screenshot of an example of this is shown at the bottom of this answer.

In simple terms, this formula combines the names from each row into a single string (per row), searches for each name within that combined string, filters the duration value if there is a match, and then sums that value.

example

Hope this helped! Let me know if there is anything I should explain further or better clarify.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文