Google Sheets - 具有动态范围的 countif
在 sheet1
中有一列包含 ID 列表,每个 ID 都有一组状态:
ID Apr May Jun
1 Load Load Complete
2 Load Complete NA
3 Load Load Load
在单独的工作表sheet2 中,我有一个 ID 列表,我试图显示其中哪些是完整的。我的想法是使用 address
函数将 countif
与动态单元格范围结合使用:
=countif("'sheet1'!"&address(row(index('sheet1'!$A$1:$A$5,match(A2,'sheet1'!$A$1:$A$5,0),1)),3)&":"&ADDRESS(row(index('sheet1'!$A$1:$A$5,match(A5,'sheet1'!$A$1:$A$500,0),1))+1,26),"Completed")
此公式应该找到每个 Id 的相关行,然后检查是否有任何值该行中的“已完成”。当与 if
函数结合使用时,这应该在 sheet2
中给出以下输出:
ID Complete
1 Y
2 Y
3 N
但目前,它没有像 countif 公式返回那样完整地注册任何内容每行 0。
这是因为 countif
无法使用 address
处理动态范围吗?如果有更好的方法来做到这一点,请告诉我。
In sheet1
have a column with a list of IDs, each with a set of statuses:
ID Apr May Jun
1 Load Load Complete
2 Load Complete NA
3 Load Load Load
In a separate sheet, sheet2 I have a list of the IDs and I am trying to show which of those are complete. My thinking is to use countif
with a dynamic cell range using the address
function:
=countif("'sheet1'!"&address(row(index('sheet1'!$A$1:$A$5,match(A2,'sheet1'!$A$1:$A$5,0),1)),3)&":"&ADDRESS(row(index('sheet1'!$A$1:$A$5,match(A5,'sheet1'!$A$1:$A$500,0),1))+1,26),"Completed")
This formula should find the relevant row for each Id and then check to see whether there are any values of 'Completed' in that row. When combined with an if
function, this should give an output of the following in sheet2
:
ID Complete
1 Y
2 Y
3 N
But at the moment, it is not registering any as complete as the countif formula is returning a 0 for every row.
Is this because countif
cannot handle dynamic ranges using address
? If there is a better way to do this, please let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试:
或:
try:
or:
根据您的数据,请尝试以下操作
(一如既往,请根据您的需要调整范围)
使用的函数:
INDEX
IF
REGEXMATCH
Given your data, please try the following
(As always, please adjust ranges to your needs)
Functions used:
INDEX
IF
REGEXMATCH