+ Reply to Thread
Results 1 to 7 of 7

Counting with multiple criteria

  1. #1
    Registered User
    Join Date
    09-16-2007
    Posts
    4

    Counting with multiple criteria

    I'm interested in populating a table that counts from the data set based on two values:
    - the range that the predicted value falls into
    - the actual value that occured

    Please see attached for an example (attached as zip since it won't let me upload xls). In this example, I have manually counted the output in the "counting table", but would like this to be done automatically as it is for a large data set.

    Any advice anyone can provide will be greatly appreciated! Thank you!

    Anita
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Anita

    Try

    A4: =SUMPRODUCT(--($A$3:$A$12>=$D4),--($A$3:$A$12<=$E4),--($B$3:$B$12=F$3))

    Copy down / across as required.


    rylo

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Just one note - you will get incorrect results if you use >= and <= due to your ranges overlapping (0.00-0.10, 0.10-0.20, etc.)

    I'd recommend either changing your ranges to not overlap, or use >= and <, so the first group would be 0.00 to 0.09, then 0.10 to 0.19, etc.

  4. #4
    Registered User
    Join Date
    09-16-2007
    Posts
    4
    Pjoaquin and Rylo,

    Thank you VERY much!! I was trying to learn from some of the other posts on SUMPRODUCT and still haven't quite figured it out. I'll need to spend some time getting smart on it because it appears to be very useful.

    Thank you thank you thank you.
    Anita

  5. #5
    Registered User
    Join Date
    09-16-2007
    Posts
    4
    One follow-up question:

    Some of the "Actual" data fields on my larger sheet are empty since the actual hasn't occured yet. The current formula accounts the blank as an Actual of 0. Is it possible to have it not count it if the Actual is blank?

    I thought about doing an IF statement, but I think that will only work on one cell, as opposed to the whole range.

    Thanks again,
    Anita

  6. #6
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hi anita,

    You should be able to amend the formula to:
    Please Login or Register  to view this content.
    The additional test for blank cells should do the trick.

  7. #7
    Registered User
    Join Date
    09-16-2007
    Posts
    4
    Perfect - Thanks Paul!

+ 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