Counta Range of text leaving out blanks

brianfosterblack

Active Member
Joined
Nov 1, 2011
Messages
251
I have a range of cells in which each cell has a formula. the formula will result in ether text being entered in a cell or leave it blank (in other words ="")
I want to count all the cells which are not blank and all will have text or dates in them - no numbers
If I use
Excel Formula:
counta(B3:B6)
It counts the blanks and I get an answer of 4 when only 1 cell has text in.
If I use
Excel Formula:
counta(B3:B6)-countif(B3:B6,"")
I get the correct answer of 1
However I want to enter the formula to extend up to column B28 for staff who will later use these columns to enter more date but in this case the second formula does not work as there are many more blank cells
Can anyone please help.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
This is other option:
Excel Formula:
=COUNTA(B3:B28)-COUNTBLANK(B3:B28)-COUNT(B3:B28)
 
Last edited:
Upvote 0
This Might be work for you

24-08-21 Exp.xlsx
JKLMNO
311106
4 6
5 
644
755
8 
977
1088
11 
121010
Sheet2
Cell Formulas
RangeFormula
O3O3=COUNT(K3:K12,ISNUMBER(K3:K12))
M3M3=COUNTA(K3:K12)
M4M4=COUNTA(K3:K12)-COUNTIFS(K3:K12,"")
K3:K12K3=IF(ISNUMBER(J3),J3,"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
I have a range of cells in which each cell has a formula. the formula will result in ether text being entered in a cell or leave it blank (in other words ="")
I want to count all the cells which are not blank and all will have text or dates in them - no numbers
If I use
Excel Formula:
counta(B3:B6)
It counts the blanks and I get an answer of 4 when only 1 cell has text in.
If I use
Excel Formula:
counta(B3:B6)-countif(B3:B6,"")
I get the correct answer of 1
However I want to enter the formula to extend up to column B28 for staff who will later use these columns to enter more date but in this case the second formula does not work as there are many more blank cells
Can anyone please help.

hi,

you don't want to count numbers because you obtain 0 in formula, right?

i did this:

in column A i putted:
Excel Formula:
=IF(B1="";"";B1)


in your case, it will be another cell

And than the formula is:
Excel Formula:
=SUMPRODUCT((A1:A20<>"")+0)
 
Upvote 0
Solution
Try this:

=SUMPRODUCT(--(LEN(B3:B28)>0))
Although this can work, this doesn't exclude the cells with a number from the count, like the OP asked for.
And on that remark:

will have text or dates in them

You've mentioned this. Will the date mentioned in the cell be a date formatted as date (which Excel will consider as a number) or will it be a date in a text field( hence considered as a textstring)?
 
Upvote 0
Although this can work, this doesn't exclude the cells with a number from the count, like the OP asked for.
And on that remark:



You've mentioned this. Will the date mentioned in the cell be a date formatted as date (which Excel will consider as a number) or will it be a date in a text field( hence considered as a textstring)?
I My dates are formatted as dates but I tried the formula Count (Range) and it counted the dates.
 
Upvote 0
hi,

you don't want to count numbers because you obtain 0 in formula, right?

i did this:

in column A i putted:
Excel Formula:
=IF(B1="";"";B1)


in your case, it will be another cell

And than the formula is:
Excel Formula:
=SUMPRODUCT((A1:A20<>"")+0)
This works perfectly. Thank you all for your help. Much appreciated
Excel Formula:
        =SUMPRODUCT((A1:A20<>"")+0)
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,192
Members
449,072
Latest member
DW Draft

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