#1   Report Post  
DougMc
 
Posts: n/a
Default using COUNTA

How can I ignore a blank cell (spacebar pressed) when using COUNTA. I want
to count cells with valid data where a spacebar press in invalid. A blank
cell is valid (so is not counted)
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

One way

=SUMPRODUCT(--(A1:A1000<" "),--(LEN(A1:A1000)0))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"DougMc" wrote in message
...
How can I ignore a blank cell (spacebar pressed) when using COUNTA. I

want
to count cells with valid data where a spacebar press in invalid. A blank
cell is valid (so is not counted)



  #3   Report Post  
DougMc
 
Posts: n/a
Default

Thanks for your help. I made a small modification to come up with

SUMPRODUCT(--(A1:A100<" "),--(LEFT(A1:A100)CHAR(32)))

This achieved what I wanted. (anything = than Char(32) is not included in
the count)

I am interested in understanding the purpose of -- preceeding the cell
array? Any advice would be appreciated. However I guess the main point is
it works!

Thanks

"Bob Phillips" wrote:

One way

=SUMPRODUCT(--(A1:A1000<" "),--(LEN(A1:A1000)0))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"DougMc" wrote in message
...
How can I ignore a blank cell (spacebar pressed) when using COUNTA. I

want
to count cells with valid data where a spacebar press in invalid. A blank
cell is valid (so is not counted)




  #4   Report Post  
Max
 
Posts: n/a
Default

"DougMc" wrote ...
....
I am interested in understanding the purpose of --
preceeding the cell array? ...


It's to coerce the TRUE, FALSE returns in the arrays to 1's and 0's to
enable, in this instance, SUMPRODUCT's calculations to proceed further with.

Perhaps try also the 2* responses in this previous post:

http://tinyurl.com/64py9

*Bob Phillips' link to his page, and
Jason's example and explanation, with a nice touch on its evolution

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----


  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

You could simplify this to

=SUMPRODUCT(--(TRIM(A1:A100)<""))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"DougMc" wrote in message
...
Thanks for your help. I made a small modification to come up with

SUMPRODUCT(--(A1:A100<" "),--(LEFT(A1:A100)CHAR(32)))

This achieved what I wanted. (anything = than Char(32) is not included in
the count)

I am interested in understanding the purpose of -- preceeding the cell
array? Any advice would be appreciated. However I guess the main point

is
it works!

Thanks

"Bob Phillips" wrote:

One way

=SUMPRODUCT(--(A1:A1000<" "),--(LEN(A1:A1000)0))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"DougMc" wrote in message
...
How can I ignore a blank cell (spacebar pressed) when using COUNTA. I

want
to count cells with valid data where a spacebar press in invalid. A

blank
cell is valid (so is not counted)






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
using COUNTA on a field that has been filtered [email protected] Excel Discussion (Misc queries) 1 April 13th 05 04:59 AM
COUNTA, COUNTIF? Newbie Excel Worksheet Functions 1 March 18th 05 11:33 AM
Unable to Copy COUNTA() with cell references EugenioB Excel Worksheet Functions 1 February 16th 05 01:07 PM
Problems copying cells using offset and counta hlckom Excel Discussion (Misc queries) 4 January 30th 05 12:49 AM
COUNTA Function not working =COUNTA(C3:C69,"NH") MikeinNH Excel Worksheet Functions 2 November 8th 04 01:19 AM


All times are GMT +1. The time now is 02:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"