CountA formula counting blank cells with formula

vikramisrani

New Member
Joined
Aug 25, 2014
Messages
4
Hi,

I am using CountA to count the cells yielding a value.

These cell have a formula that leaves the cell "blank" if a criteria is not met.

However, ContA is also counting the cells with no value, but just a formula (yielding blank as result).

Any suggestion on this issue will be a great help.

Please suggest.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi,

I am using CountA to count the cells yielding a value.

These cell have a formula that leaves the cell "blank" if a criteria is not met.

However, ContA is also counting the cells with no value, but just a formula (yielding blank as result).

Any suggestion on this issue will be a great help.

Please suggest.


Hmm, you just want the cells with values(numbers) use =COUNT()
COUNTA means countALL. So you will count cells with formulas aswell, even though they return ""

Does this help`?
 
Last edited:
Upvote 0
Hi,

I am using CountA to count the cells yielding a value.

These cell have a formula that leaves the cell "blank" if a criteria is not met.

However, ContA is also counting the cells with no value, but just a formula (yielding blank as result).

Any suggestion on this issue will be a great help.

Please suggest.

COUNTA counts non-blank cells, and "" is not considered blank, so a cell containing "" will be counted. If you are trying to count numbers, simply use the COUNT function. If you want to count all non-blank values but exclude the "" values, you could try an array formula. The following will achieve what I expect you are desiring for column A:
Code:
=SUM(IF(LEN(A:A)>0,1,0))
Remember that the array formula must be entered with Ctrl+Shift+Enter and not just Enter.

I hope this helps!
 
Upvote 0
COUNTA counts non-blank cells, and "" is not considered blank, so a cell containing "" will be counted. If you are trying to count numbers, simply use the COUNT function. If you want to count all non-blank values but exclude the "" values, you could try an array formula. The following will achieve what I expect you are desiring for column A:
Code:
=SUM(IF(LEN(A:A)>0,1,0))
Remember that the array formula must be entered with Ctrl+Shift+Enter and not just Enter.

I hope this helps!


You could avoid an Array formula by using this:

=SUMPRODUCT(--(A:A<>"")) This counts text and numbers, but not the cells with formulas returning ""
 
Upvote 0
Another solution that avoids the array formula is:

=COUNT(A:A)+COUNTIF(A:A,"?*")

There are often many ways to skin a cat! :)
 
Upvote 0
Thanks Arithos, but I have text in cells and not numbers. Is there any alternative for that?

=SUMPRODUCT(--(A:A<>"")) this returns text aswell as numbers,

is there numbers inbetween the text you dont want to count?

If not use the formula I posted here. (and earlier in the thread) =)


**EDIT** Just saw your reply! Glad to help, and yes, it is awesome ;D
 
Upvote 0

Forum statistics

Threads
1,216,073
Messages
6,128,641
Members
449,461
Latest member
kokoanutt

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