Function Problems

How to Count Rows with at Least One Nonblank Cell in Excel

Algirdas JasaitisAlgirdas Jasaitis Oct 28, 2026 870 views

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.

How to Count Rows with at Least One Nonblank Cell in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the target cell

Click on the cell where you want the final row count to appear (e.g., the Total Students cell).

2
Enter the MMULT formula

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.

3
Review the result

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 Dynamic Array Formula (No Helper Column)
Legacy Excel Requirement: If you are using an older version of Excel that does not support dynamic arrays natively, you must press Ctrl+Shift+Enter to execute this as an array formula.
Process Data Effectively

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. 1. Open your dataset: Launch WPS Spreadsheet and open the file containing your attendance or raw data.
  2. 2. Select the result cell: Click on the cell where you want the final row count to be displayed.
  3. 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.
Fully compatible with Microsoft Excel formulas including MMULT, SUM, and COUNTAHandles dynamic array formulas effortlessly out of the boxLightweight application with high performance for large datasetsFree and intuitive alternative for daily data analysis tasks
microsoft office alternative - wps office

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.