ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Ignoring Cells with Only Spaces (https://www.excelbanter.com/excel-worksheet-functions/137675-ignoring-cells-only-spaces.html)

Heliocracy

Ignoring Cells with Only Spaces
 
I'm trying to use the COUNTA function, but I need it to ignore cells that
contain ONLY spaces. I don't want to ignore cells that merely begin or end
with a space, and I don't know how many spaces may be present in the cells I
do want to ignore. Can anyone please help?

Thanks,
Heliocracy

Teethless mama

Ignoring Cells with Only Spaces
 
=COUNTIF(A1:A100,"* ")


"Heliocracy" wrote:

I'm trying to use the COUNTA function, but I need it to ignore cells that
contain ONLY spaces. I don't want to ignore cells that merely begin or end
with a space, and I don't know how many spaces may be present in the cells I
do want to ignore. Can anyone please help?

Thanks,
Heliocracy


Heliocracy

Ignoring Cells with Only Spaces
 
That appears to do the opposite of what I'm asking.

If cell A1=" ", COUNTIF(A1,"* ") returns a 1. I need a formula to return a
zero if there are only spaces in cell A1.

Thanks.

"Heliocracy" wrote:

I'm trying to use the COUNTA function, but I need it to ignore cells that
contain ONLY spaces. I don't want to ignore cells that merely begin or end
with a space, and I don't know how many spaces may be present in the cells I
do want to ignore. Can anyone please help?

Thanks,
Heliocracy


Ron Coderre

Ignoring Cells with Only Spaces
 
Try something like this:

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

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Heliocracy" wrote:

I'm trying to use the COUNTA function, but I need it to ignore cells that
contain ONLY spaces. I don't want to ignore cells that merely begin or end
with a space, and I don't know how many spaces may be present in the cells I
do want to ignore. Can anyone please help?

Thanks,
Heliocracy


Heliocracy

Ignoring Cells with Only Spaces
 
Yes, that does appear to do it. Thanks.

"Ron Coderre" wrote:

Try something like this:

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

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Heliocracy" wrote:

I'm trying to use the COUNTA function, but I need it to ignore cells that
contain ONLY spaces. I don't want to ignore cells that merely begin or end
with a space, and I don't know how many spaces may be present in the cells I
do want to ignore. Can anyone please help?

Thanks,
Heliocracy


Ron Coderre

Ignoring Cells with Only Spaces
 
I'm glad that worked for you....and thanks for the feedback.

***********
Regards,
Ron

XL2002, WinXP


"Heliocracy" wrote:

Yes, that does appear to do it. Thanks.

"Ron Coderre" wrote:

Try something like this:

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

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Heliocracy" wrote:

I'm trying to use the COUNTA function, but I need it to ignore cells that
contain ONLY spaces. I don't want to ignore cells that merely begin or end
with a space, and I don't know how many spaces may be present in the cells I
do want to ignore. Can anyone please help?

Thanks,
Heliocracy



All times are GMT +1. The time now is 03:46 AM.

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