Countif using last row with data in Excel?

2019-09-02 09:35发布

Without needing VBA, is there a way for me to say countif(column X, "") without counting all the empty cells that occur past the last row with data? The sheet is dynamic so I can't set it to a static range.

标签: excel
3条回答
Ridiculous、
2楼-- · 2019-09-02 10:01

Like I mentioned in my comment, you can used Named Range else MATCH(REPT("z",255),A:A) will give you the row number of last cell which has data. So you can use it in CountIf like this

=COUNTIF(INDIRECT("A1:A" & MATCH(REPT("z",255),A:A)), "")

If you last row contains a numeric data then you this =MATCH(9.9E+307,A:A,1)

查看更多
【Aperson】
3楼-- · 2019-09-02 10:03

Siddharth Rout's answer is a good one and should work. If you happen to have less knowledge about the contents of the last row, you may want to try something like this:

=COUNTIF(INDIRECT("A1:A"&INDEX(MAX((A:A<>"")*(ROW(A:A))),1)),"")
查看更多
兄弟一词,经得起流年.
4楼-- · 2019-09-02 10:18
=COUNTBLANK(COLX) - COUNTBLANK(COLY)

where COLY is a column that must have a value for every valid row (say, ID value)

查看更多
登录 后发表回答