+ Reply to Thread
Results 1 to 7 of 7

Counting nonblank and non white space cells

  1. #1
    Andrew
    Guest

    Counting nonblank and non white space cells

    I have a user who wants a simple count of nonblank cells. But he wants the
    count to skip cells that have a space (or two or more) in them as well. My
    formula is

    =COUNTA(G91:OFFSET(G118,-2,0))

    I can't seem to apply trim in there anywhere. How can I give him what he
    has requested?
    Thanks.


  2. #2
    Biff
    Guest

    Counting nonblank and non white space cells

    Hi!

    Try this:

    =SUMPRODUCT(--(LEN(A1:A5)>0),--(ISERROR(FIND(CHAR
    (32),A1:A5))))

    This will count all non-blank cells that do not have *ANY*
    spaces, char(32), in them.

    Biff

    >-----Original Message-----
    >I have a user who wants a simple count of nonblank

    cells. But he wants the
    >count to skip cells that have a space (or two or more) in

    them as well. My
    >formula is
    >
    >=COUNTA(G91:OFFSET(G118,-2,0))
    >
    >I can't seem to apply trim in there anywhere. How can I

    give him what he
    >has requested?
    >Thanks.
    >
    >.
    >


  3. #3
    Aladin Akyurek
    Guest

    Re: Counting nonblank and non white space cells

    B1:

    =COUNTIF(A1:A10,"?*")+COUNT(A1:A10)

    C1:

    =B1-(B1-SUMPRODUCT(--(LEN(TRIM(A1:A10))>0)))

    C1 is the result cell.

    Andrew wrote:
    > I have a user who wants a simple count of nonblank cells. But he wants the
    > count to skip cells that have a space (or two or more) in them as well. My
    > formula is
    >
    > =COUNTA(G91:OFFSET(G118,-2,0))
    >
    > I can't seem to apply trim in there anywhere. How can I give him what he
    > has requested?
    > Thanks.
    >


  4. #4
    Ken Wright
    Guest

    Re: Counting nonblank and non white space cells

    =SUMPRODUCT(--(TRIM(A6:L26)<>""))

    --
    Regards
    Ken....................... Microsoft MVP - Excel
    Sys Spec - Win XP Pro / XL 97/00/02/03

    ----------------------------------------------------------------------------
    It's easier to beg forgiveness than ask permission :-)
    ----------------------------------------------------------------------------

    "Andrew" <[email protected]> wrote in message
    news:[email protected]...
    > I have a user who wants a simple count of nonblank cells. But he wants

    the
    > count to skip cells that have a space (or two or more) in them as well.

    My
    > formula is
    >
    > =COUNTA(G91:OFFSET(G118,-2,0))
    >
    > I can't seem to apply trim in there anywhere. How can I give him what he
    > has requested?
    > Thanks.
    >




  5. #5
    Aladin Akyurek
    Guest

    Re: Counting nonblank and non white space cells

    That's all what is asked... <g>

    Ken Wright wrote:
    > =SUMPRODUCT(--(TRIM(A6:L26)<>""))
    >


  6. #6
    Ken Wright
    Guest

    Re: Counting nonblank and non white space cells

    LOL - That was my first thought, but I must have reread that question half a
    dozen times before posting just because you had posted something different.
    <vbg>

    --
    Regards
    Ken....................... Microsoft MVP - Excel
    Sys Spec - Win XP Pro / XL 97/00/02/03

    ----------------------------------------------------------------------------
    It's easier to beg forgiveness than ask permission :-)
    ----------------------------------------------------------------------------

    "Aladin Akyurek" <[email protected]> wrote in message
    news:[email protected]...
    > That's all what is asked... <g>
    >
    > Ken Wright wrote:
    > > =SUMPRODUCT(--(TRIM(A6:L26)<>""))
    > >




  7. #7
    Andrew
    Guest

    Re: Counting nonblank and non white space cells

    Thanks. It works!

    "Ken Wright" wrote:

    > LOL - That was my first thought, but I must have reread that question half a
    > dozen times before posting just because you had posted something different.
    > <vbg>
    >
    > --
    > Regards
    > Ken....................... Microsoft MVP - Excel
    > Sys Spec - Win XP Pro / XL 97/00/02/03
    >
    > ----------------------------------------------------------------------------
    > It's easier to beg forgiveness than ask permission :-)
    > ----------------------------------------------------------------------------
    >
    > "Aladin Akyurek" <[email protected]> wrote in message
    > news:[email protected]...
    > > That's all what is asked... <g>
    > >
    > > Ken Wright wrote:
    > > > =SUMPRODUCT(--(TRIM(A6:L26)<>""))
    > > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1