将细胞参考和通配符与Google表中的标准相结合countif公式
我正在努力编写Google表中此公式的适当语法。在一个名为“游戏日志”的表中,在h列中,我有一个数据范围(每行1-10个名称)。我正在尝试构建一个Countif语句,该语句将在该列的所有行中搜索名称。同一列中可以还有其他几个名称,因此我需要使用通配符 *在每行中找到任何名称的出现。因此,例如,下面的当前代码将计算行中ADAM的所有出现。
=COUNTIF('Game Log'!H3:H102, "*Adam*")
我想做的是将硬码“ adam ”替换为单元参考(在本例中为B2)。是否可以将该单元格引用与通配符相结合?知道以下代码不起作用(因为它将返回b2的文本计数出现),但是这是可能的吗?
=COUNTIF('Game Log'!H3:H102, "*B2*")
I'm struggling with writing the proper syntax for this formula in Google Sheets. In one sheet called Game Log, in the H column I have data that can be a range of names (1 - 10 names per row). I'm trying to construct a COUNTIF statement that would search for the name in all the rows for that column. There can be several other names in the same column so I need to use the wildcard * to find any occurrence of the name in each row. So for example, the current code below would count all occurrence of Adam in the rows.
=COUNTIF('Game Log'!H3:H102, "*Adam*")
What I would like to do is replace the hard codes "Adam" with a cell reference (in this case B2). Is it possible to combine that cell reference with the wild card? The know the code below doesn't work (as it would return text counting occurrences of B2), but is something like this possible?
=COUNTIF('Game Log'!H3:H102, "*B2*")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你尝试过这样的事情吗?
应该寻找任何字符串值,然后再查看单元格值,然后再再次出现任何字符串值。从本质上讲,它只是按顺序执行单独的检查,这使您可以搜索不同的值类型(在这种情况下,字符串Wildcard +单元格值 +字符串通配符)。
Have you tried something like this?
That ought to look for any string value, followed by the cell value, followed again by any string value. It's essentially just performing separate checks, in sequence, which allows you to search for different value types (in this case string wildcard + cell value + string wildcard).