如何计算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-单元格
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屋!
查看全文