Count non-zero columns with a clear, simple formula

Are you grappling with how to count columns with values greater than zero in your spreadsheet?

3 min readMicrosoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

This is one of those spreadsheet problems that looks simple on the surface but trips up even experienced users. The user needs to count how many columns in a range contain at least one value greater than zero, with each column counted only once regardless of how many cells in it qualify. We think the challenge here is not a lack of spreadsheet knowledge, but a mismatch between how our brains naturally think about data and how traditional formulas force us to think about it.

The user is trying to solve a fundamentally column-level question with row-level tools. When you look at a table, you see columns as logical units: "Does this column have any data worth noting?" But a standard formula like COUNTIF works across ranges, not columns, and it counts every qualifying cell individually. The result is that a column with three positive values gets counted three times instead of once. The user intuitively understands the goal, but the tool keeps pulling them back to cell-by-cell logic. This friction is exactly where AI-native spreadsheets can change the experience.

What the user really needs is a way to say: "For each column in this range, check if the sum of values is greater than zero, then count how many columns pass that test." In a traditional spreadsheet, that requires an array formula or a helper row with conditional logic and then a COUNTIF on that row. It works, but it adds layers of complexity that obscure the original intent. The formula becomes a puzzle to maintain rather than a clear statement of the question being asked. We believe the real innovation in data tools will come from letting users express their intent directly, not from making them translate it into intermediate steps.

For this specific case, the cleanest solution is to use a SUMPRODUCT approach that evaluates each column as a unit. A formula like =SUMPRODUCT((D12:O12>0)*1) only works if the data is in a single row. For a multi-row range, you would need something like =SUMPRODUCT((MMULT(TRANSPOSE(ROW(D12:O15)^0),--(D12:O15>0))>0)*1). That is powerful, but it is also the kind of formula that makes users close the file and walk away. The point is not that spreadsheets cannot solve this. They can. The point is that the solution should not require users to think like a formula compiler. The tools should adapt to how people think, not the other way around.

From Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

I have a table where I'm trying to count the number of columns containing values greater than zero, but only counting once per column and I'm struggling with the formula.

The cells D12:O12 could potentially contain any value from zero or above. If only D12 contained a value this would count as 1, if D12 and E12 contained values this would count as 2, and if D12, D13 and E12 contained values this would also count as 2 as I'm only interested if the column contains data or not.

Read the original at Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community