+ Reply to Thread
Results 1 to 5 of 5

Count the criteria which have the range value

  1. #1
    Registered User
    Join Date
    11-22-2006
    Posts
    19

    Count the criteria which have the range value

    Hi there

    I would like to count a list value which have a range value for example 60-80,
    The idea is > = countif (B1:B15,"80-60").. So how i do the right command,

    try to used this;

    = SUM(INDIRECT("B"&MATCH(0.3,B$1:B$15,0)&":B"&MATCH (0.4,B$1:B$15,0)))

    but returning with #NA.

    Please correct me if I'm wrong or better idea

    br, mohsin

  2. #2
    Forum Contributor
    Join Date
    07-05-2006
    Location
    Canada
    MS-Off Ver
    2003, 2007
    Posts
    581
    Try:

    =COUNTIF(B1:B15,">=60")-COUNTIF(B1:B15,">80")

    Scott

  3. #3
    Registered User
    Join Date
    11-22-2006
    Posts
    19
    hI SCOTT

    tX, IS WORK JUST CHANGE THE <80 INSTEAD OF >80

    =COUNTIF(B175:B182,">=60")-COUNTIF(B178:B182,"< =80")

    THANK YOU VERY MUCH INDEED....

  4. #4
    Forum Contributor
    Join Date
    07-05-2006
    Location
    Canada
    MS-Off Ver
    2003, 2007
    Posts
    581
    Actually, I think if you look at what I meant, the original expression is correct.

    To explain:

    COUNTIF(B175:B182,">=60") - .... -> This counts all the values that are greater than 60.

    This also includes all the values that are greater than 80. These are the values you don't want.

    .... - COUNTIF(B175:B182,">80") -> This is the count of all items greater than 80. The other part of the expression includes these values, which you did not want.

    So, by taking all the values greater than 60, and subtracting those of them that are greater than 80, you get all the values between 60 and 80.

    Consider an example with these numbers:

    B175:B182 = 50 65 70 75 80 100 110 120 <- Editted to add 80, which somehow got deleted by me.... otherwise the example doesn't make sense. :-P

    =COUNTIF(B175:B182, ">=60") = 7
    =COUNTIF(B175:B182, ">80") = 3

    =COUNTIF(B175:B182, ">=60") - COUNTIF(B175:B182, ">80")
    = 7 - 3
    = 4

    Using COUNTIF(B175:B182, "<=80"), you'd get:
    =COUNTIF(B175:B182, ">=60") = 7
    =COUNTIF(B175:B182, "<=80") = 5

    =COUNTIF(B175:B182, ">=60") - COUNTIF(B175:B182, "<=80")
    = 7 - 5
    = 2

    Scott
    Last edited by Maistrye; 11-22-2006 at 12:56 PM.

  5. #5
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Scott,

    You are absolutely right ...

    I was about to drop a note ..
    BUT you have written an excellent explanation ... which is apparently very much needed ... this misinterpretation is indeed very common ...

    Cheers
    Carim

+ 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