具有两个垂直标准的水平 SUMIFS
我得到了以下销售表,其中提供了每个员工的销售额,但我没有他们的名字,而是他们的 ID,并且每个 ID 可能有超过 1 行。
为了将 ID 映射回姓名,我有一个包含每个员工的姓名和 ID 的查找表。
销售表:
年份 | ID | 北 | 南 | 西 | 东 |
---|---|---|---|---|---|
2020 | A | 58 | 30 | 74 | 72 |
2020 | A | 85 | 40 | 90 | 79 |
2020 | B | 9 | 82 | 20 | 5 |
2020 | B | 77 | 13 | 49 | 21 |
2020 | C | 85 | 55 | 37 | 11 |
2020 | C | 29 | 70 | 21 | 22 |
2021 | A | 61 | 37 | 21 | 42 |
2021 | A | 22 | 39 | 2 | 34 |
2021 | B | 62 | 55 | 9 | 72 |
2021 | B | 59 | 11 | 2 | 37 |
2021 | C | 41 | 22 | 64 | 47 |
2021 | C | 83 | 18 | 56 | 83 |
ID 表:
ID | 姓名 |
---|---|
A | Allison |
B | Brandon |
C | Chris |
我试图按给定年份汇总每位员工的销售额,并按姓名(而不是 ID)汇总所有交易,以便我的结果如下所示:
结果:
Report | |
---|---|
2021 | |
Allison | 258 |
Brandon | 307 |
Chris | 414 |
我想要用户能够选择年份,报告将自动按年份和姓名汇总每个人的销售额。
关于如何实现这一目标有什么想法吗?
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:
Year | ID | North | South | West | East |
---|---|---|---|---|---|
2020 | A | 58 | 30 | 74 | 72 |
2020 | A | 85 | 40 | 90 | 79 |
2020 | B | 9 | 82 | 20 | 5 |
2020 | B | 77 | 13 | 49 | 21 |
2020 | C | 85 | 55 | 37 | 11 |
2020 | C | 29 | 70 | 21 | 22 |
2021 | A | 61 | 37 | 21 | 42 |
2021 | A | 22 | 39 | 2 | 34 |
2021 | B | 62 | 55 | 9 | 72 |
2021 | B | 59 | 11 | 2 | 37 |
2021 | C | 41 | 22 | 64 | 47 |
2021 | C | 83 | 18 | 56 | 83 |
ID table:
ID | Name |
---|---|
A | Allison |
B | Brandon |
C | Chris |
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 | |
Allison | 258 |
Brandon | 307 |
Chris | 414 |
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用过滤器:
使用 SUMPRODUCT:
With FILTER:
With SUMPRODUCT: