+ Reply to Thread
Results 1 to 10 of 10

Count if max < threshold

  1. #1
    Forum Contributor
    Join Date
    07-29-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    255

    Count if max < threshold

    Hi all,

    I want a formula for counting how many students have a maximum score < 30.

    In this case (sheet attached) = 2. I will also apply it for more criteria

    Q
    Attached Files Attached Files
    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Count if max < threshold

    Which version of Excel are you using now?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Count if max < threshold

    In F5 copied down:

    =IFERROR(INDEX($A$2:$A$15,MATCH(0,INDEX(COUNTIF($F$4:F4,$A$2:$A$15),0,0),0)),"")

    In G5 copied down (if you have a new version):

    =IF(F5="","",MAXIFS($C$2:$C$15,$A$2:$A$15,F5))

    or for an older version:

    =IF(F5="","",MAX(IF($A$2:$A$15=F5,$C$2:$C$15)))

    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

    In I5:

    =COUNTIF($G$5:$G$7,"<"&30)
    Attached Files Attached Files
    Last edited by AliGW; 04-30-2021 at 03:15 AM.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Count if max < threshold

    Please try

    =SUM(IFERROR(--(MOD(AGGREGATE(15,6,MATCH(A2:A15,A2:A15,)*10^6+C2:C15,ROW(A2:A15)-ROW(A1)/(A2:A15<>A3:A16)),10^6)<30),""))

    Confirm with Ctrl+Shift+Enter
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    07-29-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    255

    Re: Count if max < threshold

    Quote Originally Posted by Bo_Ry View Post
    Please try

    =SUM(IFERROR(--(MOD(AGGREGATE(15,6,MATCH(A2:A15,A2:A15,)*10^6+C2:C15,ROW(A2:A15)-ROW(A1)/(A2:A15<>A3:A16)),10^6)<30),""))

    Confirm with Ctrl+Shift+Enter
    Thanks! I need to adapt this with a criteria by year as well. Have reposted workbook
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Count if max < threshold

    Please respond to post #2.

  7. #7
    Forum Contributor
    Join Date
    07-29-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    255

    Re: Count if max < threshold

    Its MS 365 - says Excel 2008. Feels like its a more recent version.

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Count if max < threshold

    Please try

    MS365
    =SUM(--(MAXIFS($D$2:$D$50,$A$2:$A$50,UNIQUE(FILTER($A$2:$A$50,$B$2:$B$50=J$6)),$B$2:$B$50,J$6)<30))


    older version
    =SUM(IFERROR(--(MOD(AGGREGATE(15,6,MATCH($A$2:$A$50,$A$2:$A$50,)*10^6+$D$2:$D$50,ROW($A$2:$A$50)-ROW($A$1)/($A$2:$A$50<>$A$3:$A$51)/($B$2:$B$50=J$6)),10^6)<30),""))
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    07-29-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    255

    Re: Count if max < threshold

    Should this work when selecting the whole column?

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Count if max < threshold

    Its MS 365 - says Excel 2008. Feels like its a more recent version.
    Please put MS365 in your forum profile - 2008 is just a release number, not a year!

+ 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. Replies: 1
    Last Post: 11-30-2016, 08:02 PM
  2. Replies: 1
    Last Post: 12-17-2014, 11:28 PM
  3. [SOLVED] Count number of days a threshold is exceeded
    By Richiemouse in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-20-2014, 02:23 PM
  4. Sum numbers under a threshold
    By dislexic37 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-24-2014, 09:02 AM
  5. Sum up tp a Threshold
    By TylerJamison in forum Excel General
    Replies: 1
    Last Post: 08-30-2012, 02:31 PM
  6. Count periods where threshold is exceeded
    By dieter99 in forum Excel General
    Replies: 7
    Last Post: 04-01-2009, 08:01 AM
  7. Count during a 30 day threshold
    By cc1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-11-2008, 04:37 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