在另一个工作表中查找具有相同值的单元格,并仅在另一个单元格具有值时对其求和

时间:2016-12-27 16:20:19

标签: excel google-sheets

我有一份在Sheets中生成的报告,其中包含员工的姓名,但不包含他/她的交易状态。并非每个员工都会在任何一天都在这个工作表上。

在第二张工作表中,我列出了所有员工的姓名。姓名,交易及其身份。

我想在第一个工作表中找到一个公式,在第二个工作簿中查找相同的值(员工姓名),然后汇总在他的名下的所有金钱(转移的金额)< strong> IF 事务已由第4个单元格的行进行到第一个工作簿上的LEFT(事务状态)。有没有办法做到这一点?谢谢!

1 个答案:

答案 0 :(得分:0)

SUMIF功能如何:

https://support.google.com/docs/answer/3093583?hl=en

你可以这样做:

=if(A2="foo",sumif(Sheet2!$A$2:$A$5,B2,Sheet2!$B$2:$B$5))

其中:

a2 = status for this client in the first sheet
sheet2!$a$2:$a$5 = list of all names in second sheet
b2 = name of this client in first sheet
sheet2:$b$2:$b$5 = corresponding transaction amount for each name in sheet2!$a$2:$a$5

这接近你想要的吗?