+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : Counting number of events between several numeric ranges

  1. #1
    Registered User
    Join Date
    07-04-2012
    Location
    Westcliff
    MS-Off Ver
    Excel 2007
    Posts
    14

    Counting number of events between several numeric ranges

    Good morning, I have been trying to resolve a problem with counting events between several numeric ranges. I have a single column that has numeric data in each field that could be anything from 0 to 500. I am trying to establish how many fields have numeric data between 0-1, 2-5, 6-10, 11-20, 21-30, 31-50 and 50 plus. There could be any number of repeats of the same number.

    I have experimented with several formula from the forums using countif, countifs, sumproduct etc but none of them report the true number of events. For example within the column of data I have 13 fields with data between 21 and 30 but whatever formula I use it keeps returning 11 and this type of error is the same for most of the ranges I am trying to count. I am not sure if this is relevant but within each range I could have a single number that repeats itself 20,30 or 100 times.

    Any help would be appreciated.

    Trevor

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,043

    Re: Counting number of events between several numeric ranges

    Did you try COUNTIFS formula:

    =COUNTIFS(A1:A1000, ">=1", A1:A1000, "<10")

    And so for all values.

    You can also write these values as references and use them:

    =COUNTIFS(A1:A1000, ">="&C1, A1:A1000, "<"&D1)
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    07-04-2012
    Location
    Westcliff
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Counting number of events between several numeric ranges

    Thanks for your reply it is much appreciated. I have already used the formula you advise but it fails to return the correct result based on a manual count. It does not error but is simply not accurate. I have even copied the column of numbers to a separate spreadsheet and still get inaccurate results. Almost as if Excell can't count.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,043

    Re: Counting number of events between several numeric ranges

    Can you upload example workbook?

  5. #5
    Registered User
    Join Date
    07-04-2012
    Location
    Westcliff
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Counting number of events between several numeric ranges

    Thanks again, I can upload the file but just made one observation that might influence the results that perhaps you can advise on. I notice I have the visible column formatted to zero decimal places but the underlying data has up to 13 decimal places so a 20 could be 20.37629376 for example. Could this be the problem if so how do I force the underlying data to zero decimal places. I will upload the file to you if my observation is not relevant.

    Thanks again.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,043

    Re: Counting number of events between several numeric ranges

    Doesn't matter since >20 doesn't look only whole numbers (21,22,23...) but any number greater than 20 (20.73,21.58,20.000000000000000001)

    But it won't count 19.9999999999999999 that it's visible as 20. That might be a problem.

  7. #7
    Registered User
    Join Date
    07-04-2012
    Location
    Westcliff
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Counting number of events between several numeric ranges

    Zbor,

    Thanks for your help. Your last reference did the trick. I have used your recommended formula COUNTIFS and for example instead of putting in 2 and 5 into the formula to count data between 2 and 5 I have entered 1.5 and 5.5 into the formula and it works. I tried it for all the other ranges and it worked perfectly. It seems the underlying data with extended decimal points was the problem. Thanks for the quick response and help.

    Take care

    Trevor

+ 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