如何添加COUNTIFS,我看了其他主题,但是没有用

时间:2019-01-02 21:55:25

标签: excel google-docs

我正在尝试在一个工​​作簿中跨多个工作表设置一个统计。

我到了这一步:countifs(Sheet1!A:A,"Banana",Sheet1!C:C,"Yellow"):它给了我答案,但是现在我试图跨页做同样的事情并总结答案。在我的脑海中会是这样的:

=SUM((countifs(Sheet1!A:A,"Banana",Sheet1!C:C,"Yellow"),(COUNTIFS(Sheet2!A:A, "Banana",SHeet1!C:C,"Yellow"))

但这不起作用。

2 个答案:

答案 0 :(得分:1)

如果要两张纸的总和: 您在Sheet1中将H大写,但忘记将其更改为Sheet2

=SUM(COUNTIFS(Sheet1!A:A,"Banana",Sheet1!C:C,"Yellow"),COUNTIFS(Sheet2!A:A,"Banana",Sheet2!C:C,"Yellow")


在这种情况下,除非要从Sheet2获得香蕉和从Sheet1获得黄色: =COUNTIFS(Sheet2!A:A,"Banana",Sheet1!C:C,"Yellow")

答案 1 :(得分:0)

这仅在Excel中有效:

将一个工作表名称的列表放在一个范围内,名称范围为Sheets,然后使用:

=SUMPRODUCT(COUNTIFS(INDIRECT("'" & Sheets & "'!A:A"),"Banana",INDIRECT("'" & Sheets & "'!C:C"),"Yellow"))