+ Reply to Thread
Results 1 to 12 of 12

CountIf Function

  1. #1
    Barb Miles
    Guest

    CountIf Function

    I have a range of numbers between 1 and 25 in 50 cells.

    How could I use the countif function to look at that range of numbers for
    values between 5 and 10 and count those values that meet the criteria of
    between 5 and 10?

    Or if there is another function to use, let me know.

    Thank you.
    --
    Barb

  2. #2
    Bondi
    Guest

    Re: CountIf Function


    Barb Miles wrote:
    > I have a range of numbers between 1 and 25 in 50 cells.
    >
    > How could I use the countif function to look at that range of numbers for
    > values between 5 and 10 and count those values that meet the criteria of
    > between 5 and 10?
    >
    > Or if there is another function to use, let me know.
    >
    > Thank you.
    > --
    > Barb


    Hi Barb,

    Maybe you can use the Sumproduct()

    Something along the lines of:

    =SUMPRODUCT(--(A1:A50>5),--(A1:A50<10))

    Regards,
    Bondi


  3. #3
    bpeltzer
    Guest

    RE: CountIf Function

    Use countif twice, once to count those that are >=5 and a second time to
    count those that are >10. The difference is the count of those in the range
    [5,10]:
    =countif(range,">=5")-countif(range,">10")

    "Barb Miles" wrote:

    > I have a range of numbers between 1 and 25 in 50 cells.
    >
    > How could I use the countif function to look at that range of numbers for
    > values between 5 and 10 and count those values that meet the criteria of
    > between 5 and 10?
    >
    > Or if there is another function to use, let me know.
    >
    > Thank you.
    > --
    > Barb


  4. #4
    Barb Miles
    Guest

    Re: CountIf Function

    Doesn't the sumproduct function ADD the values, not count them?
    --
    Barb


    "Bondi" wrote:

    >
    > Barb Miles wrote:
    > > I have a range of numbers between 1 and 25 in 50 cells.
    > >
    > > How could I use the countif function to look at that range of numbers for
    > > values between 5 and 10 and count those values that meet the criteria of
    > > between 5 and 10?
    > >
    > > Or if there is another function to use, let me know.
    > >
    > > Thank you.
    > > --
    > > Barb

    >
    > Hi Barb,
    >
    > Maybe you can use the Sumproduct()
    >
    > Something along the lines of:
    >
    > =SUMPRODUCT(--(A1:A50>5),--(A1:A50<10))
    >
    > Regards,
    > Bondi
    >
    >


  5. #5
    Registered User
    Join Date
    06-28-2006
    Posts
    29
    Enter the following

    =SUM((((A1:A20)<10)+((A1:A20))>5)*1)

    After entering the above you need to press the Ctrl, Shift and Enter keys to enter it as an array.

  6. #6
    Bondi
    Guest

    Re: CountIf Function


    Barb Miles wrote:
    > Doesn't the sumproduct function ADD the values, not count them?
    > --
    > Barb
    >
    >
    > "Bondi" wrote:
    >
    > >
    > > Barb Miles wrote:
    > > > I have a range of numbers between 1 and 25 in 50 cells.
    > > >
    > > > How could I use the countif function to look at that range of numbers for
    > > > values between 5 and 10 and count those values that meet the criteria of
    > > > between 5 and 10?
    > > >
    > > > Or if there is another function to use, let me know.
    > > >
    > > > Thank you.
    > > > --
    > > > Barb

    > >
    > > Hi Barb,
    > >
    > > Maybe you can use the Sumproduct()
    > >
    > > Something along the lines of:
    > >
    > > =SUMPRODUCT(--(A1:A50>5),--(A1:A50<10))
    > >
    > > Regards,
    > > Bondi
    > >
    > >


    Hi,
    Well it does sum the products. But in this case the products will be 1
    when both conditions are met and 0 if none or only one of the
    conditions are met. So it will sum all the 1's where both conditions
    are met and hence function somthing like a counting function.

    Regards,
    Bondi


  7. #7
    Barb Miles
    Guest

    RE: CountIf Function

    This does not work. It returns an answer of one more than the answer should
    be.
    --
    Barb


    "bpeltzer" wrote:

    > Use countif twice, once to count those that are >=5 and a second time to
    > count those that are >10. The difference is the count of those in the range
    > [5,10]:
    > =countif(range,">=5")-countif(range,">10")
    >
    > "Barb Miles" wrote:
    >
    > > I have a range of numbers between 1 and 25 in 50 cells.
    > >
    > > How could I use the countif function to look at that range of numbers for
    > > values between 5 and 10 and count those values that meet the criteria of
    > > between 5 and 10?
    > >
    > > Or if there is another function to use, let me know.
    > >
    > > Thank you.
    > > --
    > > Barb


  8. #8
    Registered User
    Join Date
    06-28-2006
    Posts
    29
    Barb,

    Don't know if you found the answer yet but here a formula that should work for you. Let me know if it does.

    =COUNTIF(A1:A50,">=5")-COUNTIF(A1:A50,">10")

    Ed

  9. #9
    Registered User
    Join Date
    07-19-2006
    Posts
    6

    countif

    I have a similar issue.

    I am trying to count two columns with different data.


    =countif(E5:E10,"=F") and (F5:F10,"=X")
    =countif(E5:E10,"=M") and (F5:F10,"=X")

    I am not getting any results

    Jim

  10. #10
    Forum Contributor
    Join Date
    07-05-2006
    Location
    Canada
    MS-Off Ver
    2003, 2007
    Posts
    581
    Quote Originally Posted by excesspotential
    I have a similar issue.

    I am trying to count two columns with different data.


    =countif(E5:E10,"=F") and (F5:F10,"=X")
    =countif(E5:E10,"=M") and (F5:F10,"=X")

    I am not getting any results

    Jim
    Basically, just copy what Bondi stated up above:

    =SUMPRODUCT(--(A1:A50>5),--(A1:A50<10))

    except twist it into:

    =SUMPRODUCT(--(E5:E10="F"),--(F5:F10="X"))
    =SUMPRODUCT(--(E5:E10="M"),--(F5:F10="X"))

    Scott

  11. #11
    Registered User
    Join Date
    07-19-2006
    Posts
    6
    Outstanding

  12. #12
    Registered User
    Join Date
    07-19-2006
    Posts
    2

    Thumbs up

    Yes I agree, OUTSTANDING! I've read many threads looking for a simple formula like this that works. Well Done!

+ 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