英文:
Google sheet ranges
问题
Is it possible to we can pass column ranges in numbers like rows
example basically if we want to count column A we write =COUNT(A:A)
I want to count column a by its column index =COUNT(1:1)
英文:
Is it possible to we can pass column ranges in numbers like rows
example basically if we want to count column A we write =COUNT(A:A)
I want to count column a by its column index =COUNT(1:1)
答案1
得分: 1
=COUNTA(OFFSET($A$1,0,B1-1):OFFSET($A$1,ROWS(A:A)-1,B1-1))
在这个示例中,假设你在B1中输入列号为4,它将计算D列中的6个元素。
英文:
Mmm, what you can do is to create some kind of OFFSET from A1. Let's say you input the column number in B1:
=COUNTA(OFFSET($A$1,0,B1-1):OFFSET($A$1,ROWS(A:A)-1,B1-1))
In this example, see as I've put input 4 and counts the 6 elements in column D:
答案2
得分: 0
如果你的表格有A到Z列,你可以使用以下公式:
=count(index(A:Z,,1))
更一般的情况可以使用:
=COUNT(index(A1:indirect(address(rows(A:A),columns(1:1))),,1))
来计算第1列和第2列。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论