ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count cells with length not equal to 7 (https://www.excelbanter.com/excel-worksheet-functions/21007-count-cells-length-not-equal-7-a.html)

cottage6

Count cells with length not equal to 7
 
I want to count the number of cells in a column that do not have a value that
is 7 digits in length. I've tried several combinations of CountIf and Len
and have failed miserably! Can anyone help?

Peo Sjoblom

Try

=SUMPRODUCT(--(LEN(TRIM(A1:A10))<7))


Regards,

Peo Sjoblom


"cottage6" wrote:

I want to count the number of cells in a column that do not have a value that
is 7 digits in length. I've tried several combinations of CountIf and Len
and have failed miserably! Can anyone help?


Don Guillett

try
=SUMPRODUCT((LEN(A2:A22)<7)*1)

--
Don Guillett
SalesAid Software

"cottage6" wrote in message
...
I want to count the number of cells in a column that do not have a value

that
is 7 digits in length. I've tried several combinations of CountIf and Len
and have failed miserably! Can anyone help?




cottage6

Thanks to both Peo and Don whose formulas solved my problem. One additional
question; can I leave blank cells out of the count?

"Peo Sjoblom" wrote:

Try

=SUMPRODUCT(--(LEN(TRIM(A1:A10))<7))


Regards,

Peo Sjoblom


"cottage6" wrote:

I want to count the number of cells in a column that do not have a value that
is 7 digits in length. I've tried several combinations of CountIf and Len
and have failed miserably! Can anyone help?


Don Guillett

sure. just add the
a1:a10<0 parameter
=SUMPRODUCT((LEN(TRIM(A1:A10))<7)*(a1:a10<))

--
Don Guillett
SalesAid Software

"cottage6" wrote in message
...
Thanks to both Peo and Don whose formulas solved my problem. One

additional
question; can I leave blank cells out of the count?

"Peo Sjoblom" wrote:

Try

=SUMPRODUCT(--(LEN(TRIM(A1:A10))<7))


Regards,

Peo Sjoblom


"cottage6" wrote:

I want to count the number of cells in a column that do not have a

value that
is 7 digits in length. I've tried several combinations of CountIf and

Len
and have failed miserably! Can anyone help?




cottage6

Don, thanks a lot. I'm quite jealous of your logic!

"Don Guillett" wrote:

sure. just add the
a1:a10<0 parameter
=SUMPRODUCT((LEN(TRIM(A1:A10))<7)*(a1:a10<))

--
Don Guillett
SalesAid Software

"cottage6" wrote in message
...
Thanks to both Peo and Don whose formulas solved my problem. One

additional
question; can I leave blank cells out of the count?

"Peo Sjoblom" wrote:

Try

=SUMPRODUCT(--(LEN(TRIM(A1:A10))<7))


Regards,

Peo Sjoblom


"cottage6" wrote:

I want to count the number of cells in a column that do not have a

value that
is 7 digits in length. I've tried several combinations of CountIf and

Len
and have failed miserably! Can anyone help?





Don S

On Thu, 7 Apr 2005 08:17:13 -0700, "cottage6"
wrote:

I want to count the number of cells in a column that do not have a value that
is 7 digits in length. I've tried several combinations of CountIf and Len
and have failed miserably! Can anyone help?



Here's one way:

Assume your data starts in B1. Enter =IF(LEN(B1)<7,0,1)
in C1 & copy it down. Then Sum column C.

I'm sure you'll get several answers, some probably cleaner than this
one, however, it may get you on your way for now.

Don S


All times are GMT +1. The time now is 11:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com