How to Count Rows with at Least One Nonblank Cell in Excel
Question details
The user needs to count the number of rows in a dataset that contain at least one nonblank cell, while ignoring completely blank rows.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking weekly attendance or analyzing datasets where rows should only be counted if they have at least one valid entry.
- Observed behavior
- The user wants to evaluate multiple columns per row and return a total count of rows containing data, ideally without relying on helper columns.
Ensure your dataset does not contain unintended hidden spaces or formatting, as Excel might interpret these as nonblank characters. Select empty-looking cells and press 'Delete' to clear them completely.
Use a Dynamic Array Formula (No Helper Column)
Use this advanced array formula to evaluate multiple columns and calculate the total row count directly in one cell without needing extra columns.
This formula leverages the MMULT function to perform matrix multiplication, evaluating whether each cell in a row contains data, and then sums up the rows that meet the criteria.
Click on the cell where you want the final row count to appear (e.g., the Total Students cell).
Type the formula `=SUM(--(MMULT(--(A2:E11<>""),TRANSPOSE(COLUMN(A2:E11)^0))>0))` and press Enter. Be sure to replace `A2:E11` with your actual data range, excluding header rows.
The formula will instantly check every row in the specified range and add one to the total count whenever at least one cell in that row is nonblank.

Use a Helper Column with IF and ISBLANK Functions
A simpler, more beginner-friendly method that uses an extra column to flag rows with data before summing them up.
Count Complex Data Effortlessly with WPS Spreadsheet
WPS Spreadsheet supports advanced array formulas like MMULT and standard counting functions, making it incredibly easy to track attendance or analyze nonblank rows without paying for expensive software.
- 1. Open your dataset: Launch WPS Spreadsheet and open the file containing your attendance or raw data.
- 2. Select the result cell: Click on the cell where you want the final row count to be displayed.
- 3. Input the array formula: Paste the `=SUM(--(MMULT(--(A2:E11<>""),TRANSPOSE(COLUMN(A2:E11)^0))>0))` formula, adjust your specific range, and press Enter to instantly get your accurate row count.

Frequently Asked Questions
Why does my formula count rows that appear empty?
If a cell contains a space character, an invisible apostrophe, or a formula returning an empty string (""), Excel treats it as a nonblank cell. To fix this, select the empty-looking cells and press the 'Delete' key on your keyboard to clear their contents entirely.
Can I use the COUNTA function to count rows with nonblank cells?
The standard COUNTA function counts individual nonblank cells, not entire rows. To count rows, you must either use COUNTA inside a helper column for each row (e.g., =IF(COUNTA(A2:E2)>0, 1, 0)), or use an array formula like MMULT to process multiple columns at once.
How does the MMULT formula work for counting rows?
The MMULT function performs matrix multiplication. In this formula, it multiplies an array of True/False values (checking if cells are not blank) by an array of 1s (generated by the COLUMN function). This operation effectively calculates the sum of nonblank cells per row, which the outer SUM function then counts if the value is greater than zero.




