如何计算 Excel 工作表中包含数据的行数? [英] How can I count the rows with data in an Excel sheet?
本文介绍了如何计算 Excel 工作表中包含数据的行数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试计算电子表格中的行数,这些行数在几列中至少包含一个非空值:即
I am trying to count the number of rows in a spreadsheet which contain at least one non-blank value over a few columns: i.e.
row 1 has a text value in column A
row 2 has a text value in column B
row 3 has a text value in column C
row 4 has no values in A, B or C
该公式将等于 3,因为第 1、2 和 &3 在至少一列中有一个文本值.类似地,如果第 1 行在每列(A、B 和 C)中都有一个文本值,这将被计为 1.
The formula would equate to 3, because rows 1, 2, & 3 have a text value in at least one column. Similarly if row 1 had a text value in each column (A, B, & C) this would be counted as 1.
推荐答案
有了公式,你可以做的是:
With formulas, what you can do is:
- 在一个新列中(比如 col D - cell
D2
),添加=COUNTA(A2:C2)
- 将此公式拖到数据末尾(在我们的示例中说单元格
D4
) - 添加最后一个公式来总结它(例如在单元格
D5
中):=SUM(D2:D4)
- in a new column (say col D - cell
D2
), add=COUNTA(A2:C2)
- drag this formula till the end of your data (say cell
D4
in our example) - add a last formula to sum it up (e.g in cell
D5
):=SUM(D2:D4)
这篇关于如何计算 Excel 工作表中包含数据的行数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文