+ Reply to Thread
Results 1 to 6 of 6

Counting data between 2 values

  1. #1
    CMO
    Guest

    Counting data between 2 values

    Hi,

    I have a list of durations on 1 cell (as below).

    1
    21
    54
    72
    95
    170
    etc....

    I want to count how many of them are between 0 and 60, how many between 61
    and 120, so on and so forth. I have tried using Countif, but can't get it to
    work. My last attempt was =count(if(and('Site
    list_South'!$E$2:$E$5000>=0,'Site list_South'!$E$2:$E$5000<=60)) and it
    failed miserably.

    Please Help!!!!



  2. #2
    Forum Contributor
    Join Date
    06-01-2006
    Posts
    324
    =countif(e2:e5000,">=0")-countif(e2:e5000,">60")
    =countif(e2:e5000,">=61")-countif(e2:e5000,">120")
    =countif(e2:e5000,">=121")-countif(e2:e5000,">180")
    =countif(e2:e5000,">=181")-countif(e2:e5000,">240")
    Google is your best friend!

  3. #3
    Marcelo
    Guest

    RE: Counting data between 2 values

    hi CMO,

    you could use sumproduct as:

    =sumproduct(--(a1:a100>=1)*--(a1:a100<=60))

    hope this helps
    Regards from Brazil
    Marcelo

    "CMO" escreveu:

    > Hi,
    >
    > I have a list of durations on 1 cell (as below).
    >
    > 1
    > 21
    > 54
    > 72
    > 95
    > 170
    > etc....
    >
    > I want to count how many of them are between 0 and 60, how many between 61
    > and 120, so on and so forth. I have tried using Countif, but can't get it to
    > work. My last attempt was =count(if(and('Site
    > list_South'!$E$2:$E$5000>=0,'Site list_South'!$E$2:$E$5000<=60)) and it
    > failed miserably.
    >
    > Please Help!!!!
    >
    >


  4. #4
    CMO
    Guest

    RE: Counting data between 2 values

    Thanks a lot, works perfectly.

    Goodbye from sunny England:-)

    "Marcelo" wrote:

    > hi CMO,
    >
    > you could use sumproduct as:
    >
    > =sumproduct(--(a1:a100>=1)*--(a1:a100<=60))
    >
    > hope this helps
    > Regards from Brazil
    > Marcelo
    >
    > "CMO" escreveu:
    >
    > > Hi,
    > >
    > > I have a list of durations on 1 cell (as below).
    > >
    > > 1
    > > 21
    > > 54
    > > 72
    > > 95
    > > 170
    > > etc....
    > >
    > > I want to count how many of them are between 0 and 60, how many between 61
    > > and 120, so on and so forth. I have tried using Countif, but can't get it to
    > > work. My last attempt was =count(if(and('Site
    > > list_South'!$E$2:$E$5000>=0,'Site list_South'!$E$2:$E$5000<=60)) and it
    > > failed miserably.
    > >
    > > Please Help!!!!
    > >
    > >


  5. #5
    Bob Phillips
    Guest

    Re: Counting data between 2 values

    * and -- is built-in redundancy, only need one or the other

    =sumproduct(--(a1:a100>=1),--(a1:a100<=60))

    or

    =sumproduct((a1:a100>=1)*(a1:a100<=60))


    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Marcelo" <[email protected]> wrote in message
    news:[email protected]...
    > hi CMO,
    >
    > you could use sumproduct as:
    >
    > =sumproduct(--(a1:a100>=1)*--(a1:a100<=60))
    >
    > hope this helps
    > Regards from Brazil
    > Marcelo
    >
    > "CMO" escreveu:
    >
    > > Hi,
    > >
    > > I have a list of durations on 1 cell (as below).
    > >
    > > 1
    > > 21
    > > 54
    > > 72
    > > 95
    > > 170
    > > etc....
    > >
    > > I want to count how many of them are between 0 and 60, how many between

    61
    > > and 120, so on and so forth. I have tried using Countif, but can't get

    it to
    > > work. My last attempt was =count(if(and('Site
    > > list_South'!$E$2:$E$5000>=0,'Site list_South'!$E$2:$E$5000<=60)) and it
    > > failed miserably.
    > >
    > > Please Help!!!!
    > >
    > >




  6. #6
    Marcelo
    Guest

    Re: Counting data between 2 values

    Hi Bob, thanks for the feedback,
    regards
    Marcelo


    "Bob Phillips" escreveu:

    > * and -- is built-in redundancy, only need one or the other
    >
    > =sumproduct(--(a1:a100>=1),--(a1:a100<=60))
    >
    > or
    >
    > =sumproduct((a1:a100>=1)*(a1:a100<=60))
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (replace somewhere in email address with gmail if mailing direct)
    >
    > "Marcelo" <[email protected]> wrote in message
    > news:[email protected]...
    > > hi CMO,
    > >
    > > you could use sumproduct as:
    > >
    > > =sumproduct(--(a1:a100>=1)*--(a1:a100<=60))
    > >
    > > hope this helps
    > > Regards from Brazil
    > > Marcelo
    > >
    > > "CMO" escreveu:
    > >
    > > > Hi,
    > > >
    > > > I have a list of durations on 1 cell (as below).
    > > >
    > > > 1
    > > > 21
    > > > 54
    > > > 72
    > > > 95
    > > > 170
    > > > etc....
    > > >
    > > > I want to count how many of them are between 0 and 60, how many between

    > 61
    > > > and 120, so on and so forth. I have tried using Countif, but can't get

    > it to
    > > > work. My last attempt was =count(if(and('Site
    > > > list_South'!$E$2:$E$5000>=0,'Site list_South'!$E$2:$E$5000<=60)) and it
    > > > failed miserably.
    > > >
    > > > Please Help!!!!
    > > >
    > > >

    >
    >
    >


+ 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