简体   繁体   English

使用COUNTA函数的结果的级联单元格引用

[英]Concatenated Cell Reference using the result of a COUNTA function

I am having some trouble with a formula. 我在使用公式时遇到了麻烦。 I am trying to use a COUNT function to set a range reference. 我正在尝试使用COUNT函数来设置范围参考。 Thank you. 谢谢。

=COUNTIF(G1:"G"&COUNTA(A1:100),1) = COUNTIF(G1:“ G”&COUNTA(A1:100),1)

使用非易失性索引。

=COUNTIF(G1:INDEX(G:G,COUNTA(A1:A100)),1)

考虑:

=COUNTIF(G1:INDIRECT("G"&COUNTA(A1:A100)),1)

From a Comment by OP: 根据OP的评论:

I would like the formula to search a range and count the number of values in column G that equal 1 我希望公式搜索范围并计算G列中等于1的值的数量

Based on Q, range seems to be first 100 rows. 基于Q,范围似乎是前100行。

I must be missing the point by a mile because: 我一定要错过这一点,因为:

=SUMIF(G1:G100,1)

seems to solve what little I understand of (and there is in) the Q (plus a Comment). 似乎可以解决我对Q的了解不多(其中包括)(加上注释)。

use indirect or offset 使用间接或偏移

=countif(G1:indirect("G"&COUNTA(A1:100)),1)

OR 要么

 =countif(offset(G1,0,0,COUNTA(A1:100),1),1)
=COUNTIF(INDIRECT("G1:G"&COUNTA(A1:A100)),1)

You are missing Indirect 您缺少间接
A1:A100 (A1:100) is not a range for countA A1:A100(A1:100)不是countA的范围
CountA will count non empty cells in column A CountA将对A列中的非空单元格进行计数
Update 更新资料
You can use another simple formula 您可以使用另一个简单的公式

=COUNTIFS(A:A,"<>",G:G,1)

Countifs will count the 1 in column G if the corresponding A <>"" 如果相应的A <>“”,Countifs将在G列中计数1。

Or: 要么:

=COUNTIFS(A1:A100,"<>",G1:G100,1)

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

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