Counta ignore formulas

HWL

Active Member
Joined
Dec 1, 2009
Messages
462
Counta typically works like this:
=counta(a2:a15) which will return the count of non-blanks in that range.

However, if I have a formula in a cell and yet the cell is blank, it counts it as populated. How do I make this work correctly? countif???
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Re: Counta ignore formulas *SOLVED*

Counta typically works like this:
=counta(a2:a15) which will return the count of non-blanks in that range.

However, if I have a formula in a cell and yet the cell is blank, it counts it as populated. How do I make this work correctly? countif???

SOLVED
=COUNTIF(a2:a15,">""")
 
Upvote 1
Thank you
Note that the formula you have quoted may produce an incorrect result, depending on the type of data the formulas in the column A range return - see cell C2 below.
For your version I have provided a more robust alternative in cell D2.

24 01 17.xlsm
ABCD
1
2-1412
3a
4-1
51
6-1
7a
8a
9-1
10 
11 
12-1
13a
14-1
151
Count
Cell Formulas
RangeFormula
C2C2=COUNTIF(A2:A15,">""")
D2D2=SUM(--(A2:A15<>""))
A2:A15A2=CHOOSE(RANDBETWEEN(1,5),-1,"a","","b",1)
 
Upvote 0
This is a very old thread. If you don't have MS365 or O2021+, the sum would need to be SumProduct
Excel Formula:
=SUMPRODUCT(--(A2:A15<>""))
 
Upvote 0

Forum statistics

Threads
1,215,501
Messages
6,125,169
Members
449,212
Latest member
kenmaldonado

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top