شنبه هجدهم مرداد ۱۳۹۹ - 21:25 - حسين حسين پور -
Count cells that are not blank
Generic formula
=COUNTA(range)
Explanation
To count cells that are not blank in a range, you can use the COUNTA function. In the example shown, D5 contains this formula:
=COUNTA(B5:B9)
How this formula works
COUNTA is fully automatic. When given a range of cells, it returns a count of cells that contain numbers, text, logical values, and errors. Empty cells are ignored.
With COUNTIF and COUNTIFS
To count non-blank cells with the COUNTIF function, you can use a formula like this:
=COUNTIF(range,"<>")
This same approach can be extended with the COUNTIFS function like this:
=COUNTIFS(rng1,">100",rng2,"<>")
Here we counting cells when the value in rng1 is greater than 100 and rng2 is not blank.