+ Reply to Thread
Results 1 to 4 of 4

Count number of occurances below a range, within a range, and below a range

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Count number of occurances below a range, within a range, and below a range

    I have a table, which contains sales number for a number of zones. For each zone, there is a range of acceptable sales. For each zone, I want to identify (1) the number of sales which were below the range (2) the number of sales which were within the range (3) the number of sale which were above the range.

    For example if the sales range for Zone1 is $250 to $800, I want to count the number of sales which were below $250, the number of sales which were between $250 and $800 and the number of sales which were above $800.

    I did try to use a SumProduct formula but couldn't figure out how to account for the 3 different ranges so not sure if that will even work. Note: the range of values for each zone does change month to month. I have attached a sample workbook with sample table of data and expected results. Thanks in advance for any comments.
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Count number of occurances below a range, within a range, and below a range

    Try this, copied across...
    below =COUNTIFS($A$2:$A$20,$A26,$C$2:$C$20,"<250")
    within =COUNTIFS($A$2:$A$20,$A26,$C$2:$C$20,">=250",$C$2:$C$20,"<800")
    above =COUNTIFS($A$2:$A$20,$A26,$C$2:$C$20,">800")

    If you put the ranges next to the zone in the 2nd table, you can reference the values instead of hard-coding them

    the sumproduct version wold be similar...
    below =SUMPRODUCT(($A$2:$A$20=A26)*($C$2:$C$20<250))
    within =SUMPRODUCT(($A$2:$A$20=A26)*($C$2:$C$20>=250)*($C$2:$C$20<800))
    Last edited by FDibbins; 09-15-2013 at 11:16 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Valued Forum Contributor
    Join Date
    09-15-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2010
    Posts
    436

    Re: Count number of occurances below a range, within a range, and below a range

    Please try this file.
    Attached Files Attached Files
    Please click 'Add reputation', if my answer helped you.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Count number of occurances below a range, within a range, and below a range

    Here's my attempt

    Ramananhrm one is more streamlined compared to mine
    i would use his
    Attached Files Attached Files
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. count occurances of range of numbers in unknown number of cells.
    By gammaman in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 10-12-2012, 06:27 AM
  2. Count the number of occurances of a value in a range.
    By pi**edasanewt in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-15-2008, 07:08 AM
  3. [SOLVED] count number of occurances of a word in a range
    By John Davies in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-24-2006, 09:50 AM
  4. Count occurances in range of cells
    By Ed Gregory in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-07-2005, 03:05 PM
  5. [SOLVED] count date occurances in range of dates...
    By Alex in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM

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