具有两个垂直标准的水平 SUMIFS

发布于 2025-01-13 09:17:08 字数 1989 浏览 4 评论 0原文

我得到了以下销售表,其中提供了每个员工的销售额,但我没有他们的名字,而是他们的 ID,并且每个 ID 可能有超过 1 行。

为了将 ID 映射回姓名,我有一个包含每个员工的姓名和 ID 的查找表。

销售表:

年份ID西
2020A58307472
2020A85409079
2020B982205
2020B77134921
2020C85553711
2020C29702122
2021A61372142
2021A2239234
2021B6255972
2021B5911237
2021C41226447
2021C83185683

ID 表:

ID姓名
AAllison
BBrandon
CChris

我试图按给定年份汇总每位员工的销售额,并按姓名(而不是 ID)汇总所有交易,以便我的结果如下所示:

结果:

Report
2021
Allison258
Brandon307
Chris414

我想要用户能够选择年份,报告将自动按年份和姓名汇总每个人的销售额。

关于如何实现这一目标有什么想法吗?

I am given the following sales table which provide the sales that each employee made, but instead of their name I have their ID and each ID may have more than 1 row.

To map the ID back to the name, I have a look up table with each employee's name and ID.

Sales Table:

YearIDNorthSouthWestEast
2020A58307472
2020A85409079
2020B982205
2020B77134921
2020C85553711
2020C29702122
2021A61372142
2021A2239234
2021B6255972
2021B5911237
2021C41226447
2021C83185683

ID table:

IDName
AAllison
BBrandon
CChris

I am trying to sum up each employee's sales by a given year, and aggregate all their transactions by their name (rather than ID), so that my result looks like the following:

Result:

Report
2021
Allison258
Brandon307
Chris414

I want the user to be able to select the year, and the report would automatically sum up each person's sales by the year and their name.

Any ideas on how I can accomplish this?

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

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

发布评论

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

评论(1

青朷 2025-01-20 09:17:08

使用过滤器:

=SUM(FILTER($C$2:$F$13,($B$2:$B$13=INDEX($I$2:$I$4,MATCH(N3,$J$2:$J$4,0)))*($A$2:$A$13=$N$2)))

“在此处输入图像描述”"

使用 SUMPRODUCT:

=SUMPRODUCT($C$2:$F$13*($B$2:$B$13=INDEX($I$2:$I$4,MATCH(N3,$J$2:$J$4,0)))*($A$2:$A$13=$N$2))

在此处输入图像描述

With FILTER:

=SUM(FILTER($C$2:$F$13,($B$2:$B$13=INDEX($I$2:$I$4,MATCH(N3,$J$2:$J$4,0)))*($A$2:$A$13=$N$2)))

enter image description here

With SUMPRODUCT:

=SUMPRODUCT($C$2:$F$13*($B$2:$B$13=INDEX($I$2:$I$4,MATCH(N3,$J$2:$J$4,0)))*($A$2:$A$13=$N$2))

enter image description here

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