+ Reply to Thread
Results 1 to 13 of 13

Removing lowest scores in data

  1. #1
    Registered User
    Join Date
    11-20-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    20

    Removing lowest scores in data

    Hi, thank you very much in advance for the help.

    I have a list containing student exam results. The following categories of data are available:
    - Course
    - Mapping
    - Course Type
    - Grade
    - Units
    - Student ID

    I need to determine the final overall grade of each student. This is calculated by summing all the "Grades" that a student has received, divided by the total number of "Units". However, here's the catch: before I calculate each student's final grade, I need to first remove the two lowest grades for each student (e.g. 1, 2, 3, 4, 4, 4, 4 --> remove 1 and 2). An additional rule: the removed grade must not be a course that is mapped to "GE" - only "Non-GE" grades may be removed. Effectively, I need to remove the two lowest Non-GE grades for each student.

    May I seek advice on how best I can generate the outcomes I want? (i.e. final overall grade for each student, after removing lowest two Non-GE grades).

    In the sample file, I included the actual data (anonymised) for 6 students - the actual document has about 3000 students.

    Thank you very much!!
    Attached Files Attached Files

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Removing lowest scores in data

    Is column G, ID the student ID?

    Can you give what you expect as the result for ID 101?
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    11-20-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    20

    Re: Removing lowest scores in data

    Hi, yes column G is student ID.

    For student 101, I will remove 2, 2.3 and one of the 2.7 grades. Then, SUM(Grade)/SUM(Units) = 3.46. That would be the outcome i'm looking for: Student 101 final grade = 3.46

    Thank you!

    Edit: sorry i had removed three grades instead of two. I should have removed only 2 and 2.3. Therefore the final grade is 3.43 instead.
    Last edited by kophanz; 01-25-2018 at 08:37 PM.

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Removing lowest scores in data

    With student ID in column L, so that
    L2 = 101

    then the following goes in M2 and thus:

    Please Login or Register  to view this content.
    This is an array formula (to take advantage of the SMALL(IF) construction to peel out the two bottom grades from Non-Ge classes), so it must be confirmed with CTRL+SHIFT+ENTER when put entered into the cell, not just by pressing the ENTER key.

    Broad strokes, what it's doing is:
    [SUM(all scores for student) - (1st lowest Non-GE score for student) - (2nd lowest Non-GE score for student)] / [SUM(count of all scores for student) -2]

    Note this delivers 3.094 -- a cursory examination makes me think that is the correct answer, not 3.43 or 3.46 as given.
    Last edited by ben_hensel; 01-25-2018 at 09:18 PM.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Removing lowest scores in data

    Hi Ben,

    I think we do need the OP to explain how they come to 3.43 and the only thing I'm not sure of on your formula is the last part where you divide by 16. The 2.3 and 2 that are removed have a unit of 1 which seems like it should be removed from the sum of unit, but what if one of those two numbers to be removed has a unit of say 0.5. At that point maybe the Sum of Unit would be minus 1.5???

    @kophanz,

    SUM(Grade)/SUM(Units) = 3.43
    Can you tell us what you have for Sum(Grade) and what do you have for Sum(Units)?
    Last edited by jeffreybrown; 01-25-2018 at 09:41 PM.

  6. #6
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Removing lowest scores in data

    uhhhh

    I was completely ignoring the units entirely, LOL; if we're going there (and looking again I think you're right to bring 'em up), then yeah we need follow up from OP on how to handle them.

  7. #7
    Registered User
    Join Date
    11-20-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    20

    Re: Removing lowest scores in data

    Hi all,
    Thank you so much for helping with this. I realised that when I replied jeff's early question, I had inadvertently used a sum formula that included grades from other students.

    After the correction, i have SUM(Grade) = 49.5, SUM(Units) = 15, hence Final Grade = 3.3

    Does this make sense to you?

    Thank you very much!
    Attached Files Attached Files

  8. #8
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Removing lowest scores in data

    How about this!

    Custom sort your data by Grade (Smallest to Largest) then by Mapping (Z to A).

    I put some new formulas in column K.

    Place you cursor on K2 then evaluate formula to see what's happening...

    Evaluate Formula
    • Click on the cell with the formula >> Ribbon >> Formulas >> Formula Auditing >> Evaluate Formula
    Attached Files Attached Files
    Last edited by jeffreybrown; 01-25-2018 at 10:51 PM.

  9. #9
    Registered User
    Join Date
    11-20-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    20

    Re: Removing lowest scores in data

    Hi Jeffrey, this works well!

    I have a slight problem though.. Some students received grades of "0" in some courses. I realised that in addition to "GE" grades, I'm also not allowed to remove "0" grades. So the rule should actually be "remove the lowest two Non-GE and non-zero grades".

    Are you able to advise on how I can change the formula for it to work?

  10. #10
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Removing lowest scores in data

    hi there. with jeffrey's method, you can add in a COUNTIFS to count how many non-GEs have zeroes. in K2:
    =SUMIF(G:G,J1,E:E)-SUM(OFFSET($G$1,MATCH(J1,G:G,0)-1+COUNTIFS(G:G,J1,C:C,"Non-GE",E:E,0),-2,2))

    in K3:
    =SUMIF(G:G,J1,F:F)-SUM(OFFSET($G$1,MATCH(J1,G:G,0)-1+COUNTIFS(G:G,J1,C:C,"Non-GE",E:E,0),-1,2))

    or if data is always unsorted, this array formula might work in K2:
    =SUMIF(G:G,K1,E:E)-SUM(SMALL(IF($G$2:$G$109=K1,IF($C$2:$C$109="Non-GE",IF($E$2:$E$19>0,$E$2:$E$109))),{1,2}))
    K3:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    or if you don't need so many breakdown, this monster will give a Grade Sum divided by units sum:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Removing lowest scores in data

    Quote Originally Posted by benishiryo View Post
    ......or if you don't need so many breakdown, this monster will give a Grade Sum divided by units sum:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Some of the ranges are incorrect in this formula. Instances of $E$2:$E$19 should, of course, be $E$2:$E$109.......but otherwise this works for me

    My suggestion would be to leave the data unsorted but add a helper column which would show an "N" on rows to be excluded. That way you can explicitly see which rows are excluded and manually adjust if required.

    To do that you can use this formula in H2 copied down

    =IF(OR(E2=0,C2="GE",COUNTIFS(G:G,G2,E:E,">0",C:C,"Non-GE",E:E,"<"&E2)+COUNTIFS(G$2:G2,G2,E$2:E2,">0",C$2:C2,"Non-GE",E$2:E2,E2)>2),"","N")

    Then to get the Final Grade for ID in J2 you can use this simple formula

    =SUMIFS(E:E,G:G,J2,H:H,"")/SUMIFS(F:F,G:G,J2,H:H,"")

    See attached where I also added conditional formatting to mark the excluded rows

    Note: using this method if there are ties for lowest non-GE, non-zero scores then this will exclude the first based on position in the data, e.g. if the lowest non-GE, non-zero scores for one specific ID are 2.3, 2.7 and 2.7 then first 2.7 (positionally) will be excluded. If it's possible for the units to be different for each of the 2.7s (e.g. one is 0.5 and the other is 1) then it makes a difference to the Final Grade which one is excluded. If you want to have a rule for that, e.g. always include the higher units when there's a tie, then you could change my helper column formula to accommodate that.
    Attached Files Attached Files
    Audere est facere

  12. #12
    Registered User
    Join Date
    11-20-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    20

    Re: Removing lowest scores in data

    Wow.. Thank you everyone, I'm now trying the different methods you've suggested. I am halfway through Jeff's suggestion, with the added COUNTIFS that benishiryo added. But I have a second set of data, and I would probably try the helper column idea for that.

    Thank you so much!

  13. #13
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Removing lowest scores in data

    We are happy to help. Best wishes for the rest of your project!

+ 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: 8
    Last Post: 12-20-2014, 04:37 PM
  2. Replies: 5
    Last Post: 12-30-2011, 06:39 PM
  3. average of lowest 3 of 5 scores >0
    By barnowl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-17-2010, 08:59 PM
  4. Names and scores of the two lowest scores
    By dmyoungsal in forum Excel General
    Replies: 3
    Last Post: 07-15-2008, 11:47 AM
  5. Total Lowest Scores
    By dmyoungsal in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-20-2007, 05:20 PM
  6. Average of lowest scores
    By Sem_Tex in forum Excel General
    Replies: 11
    Last Post: 12-19-2006, 10:33 AM
  7. [SOLVED] how to pick the lowest 10 golf scores
    By David Hurwitz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-24-2005, 05: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