具有来自相关单元格的一系列标准的Excel Countif

发布于 2025-02-11 14:44:23 字数 231 浏览 0 评论 0原文

以下作品按预期工作,并计算包含pH,v或o的范围A2:p2中的所有单元格

(countifs(a2:p2; {“ pH”;“ v”;“ v”;“ o”}))

i必须重复使用这几个地方,因此希望将标准数组放入单元格中并从那里阅读。像: = sum(countifs(a2:p2;“& a1&“”))其中cell a1包含{“ pH”;“ v”;“ o”}。

是否可以将文本从A1解析为公式?

The following works as expected and counts all the cells in the range A2:P2 that contains either PH, V or O.

=SUM(COUNTIFS(A2:P2;{"PH";"V";"O"}))

I have to reuse this several places and therefore want to place the criteria array in a cell and read it from there. Something like:
=SUM(COUNTIFS(A2:P2;"&A1&")) where cell A1 contains {"PH";"V";"O"}.

Is it possible to parse the text from A1 into the formula?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落叶缤纷 2025-02-18 14:44:23

更高版

=SUM(COUNTIFS(A2:P2;FILTERXML("<c><e>"&SUBSTITUTE(A1;";";"</e><e>")&"</e></c>";"//e")))

假设您使用Excel 2013或 array公式如果您没有动态阵列)

Assuming that you're using Excel 2013 or later, and that A1 contains the text PH;V;O the formula below should work

=SUM(COUNTIFS(A2:P2;FILTERXML("<c><e>"&SUBSTITUTE(A1;";";"</e><e>")&"</e></c>";"//e")))

(this will have to be entered as an array formula if you don't have dynamic arrays)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文