简体   繁体   English

COUNTIF 和 IMPORTRANGE 返回 0

[英]COUNTIF and IMPORTRANGE returning 0

I would like to use the COUNTIF and IMPORTRANGE functions in Google Sheets, but the results keep returning 0. Here's my formula:我想在 Google 表格中使用 COUNTIF 和 IMPORTRANGE 函数,但结果一直返回 0。这是我的公式:

=COUNTIF(IMPORTRANGE("sheet key","PDFs!A2:A13"), "Yes")

There are no permission restrictions on the sheet I am trying to query, though I might restrict it to specific people.我尝试查询的工作表没有权限限制,但我可能会将其限制为特定人员。

I've tried the formula using the key and the sheet URL.我已经尝试过使用密钥和工作表 URL 的公式。

I've tested the formula with a tab in the same sheet and it works.我已经用同一张表中的选项卡测试了公式并且它有效。 Here is the formula I used:这是我使用的公式:

 =COUNTIF(PDFs!A2:A13,"Yes")

Any thoughts on why the COUNTIF/IMPORTRANGE formula isn't working?关于为什么 COUNTIF/IMPORTRANGE 公式不起作用的任何想法?

Would restricting permissions make the formula not work?限制权限会使公式不起作用吗?

Yes, specific authorisation is necessary and no, you don't need the sheet name as well as the key.是的,需要特定授权,不,您不需要工作表名称和密钥。

Try just:试试吧:

 =IMPORTRANGE("sheet key","A2:A13")

which should ask you for authorisation (if required) and grant it (if necessary).这应该要求您授权(如果需要)并授予它(如果需要)。 Then replace above with:然后将上面替换为:

=COUNTIF(IMPORTRANGE("sheet key","A2:A13"),"Yes")

First use core Importrange formula Importrange("Key","Sheet!A2") and allow access.首先使用核心导入范围公式Importrange("Key","Sheet!A2")并允许访问。 Once sheet gets the access then apply the whole formula, ie countif(importrange("key","Sheet!A2:A),"Yes")一旦工作表获得访问权限,然后应用整个公式,即countif(importrange("key","Sheet!A2:A),"Yes")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM