+ Reply to Thread
Results 1 to 16 of 16

Identify the higest value and sum across groups

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    27

    Identify the higest value and sum across groups

    Hi Everyone,

    I have a data table (Column A-D) of students with their marks in theory and practical.

    I have to calculate total marks (Column E) per student as well as have to determine in which category student has obtained highest marks (Column F)

    Can someone please help with the formula that can calculate these numbers, the data table is very long and this activity has been identified as weekly.

    Please help.

    Best,
    Attached Files Attached Files

  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,410

    Re: Identify the higest value and sum across groups

    Your layout is not great, but try this in E2:

    =IF(A2=A3,"",SUM(C1:C2))

    and this in F2:

    =IF(E2="","",LOOKUP(MAX(C1:C2),C1:C2,D1:D2))
    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
    Registered User
    Join Date
    12-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Identify the higest value and sum across groups

    Hi AliGW,

    Thanks for your prompt response.

    Formula in column E worked perfectly, I made a slight change in E2 to =IF(A2=A1,"",SUMIF(A:A,A2,C:C)). For F2 I tried your formula but it doesn't consider column A - I apologize I didn't mentioned in my original post but there may be varying rows in names. E.g. Name A may have 3 rows and name B may have 2 rows. What changes we can make so that the formula in column F consider the groupings of names before determining the highest mark category?

  4. #4
    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,410

    Re: Identify the higest value and sum across groups

    Then you failed to mention a really rather important thing! Back to the drawing board ...

    Please attach a file that is representative of your real data and layout.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Identify the higest value and sum across groups

    Hi,

    This is clearly a much simplified example and probably doesn't represent the size of your actual data. We often find that when we give an answer to what is a trivial non representative example when the solution is used with the real world data it doesn't work because of factors like string length and other stuff which is important but hasn't been mentioned.

    Therefore upload your real workbook (or at least a cut down copy), and manually add the results you expect to see. Clearly identify which is original data and which are the results and in a note clearly explain how you have arrived at your results.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Registered User
    Join Date
    12-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Identify the higest value and sum across groups

    Attached is the file. I have manually typed what I need in column F - Appreciate your time!!
    Attached Files Attached Files

  7. #7
    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,410

    Re: Identify the higest value and sum across groups

    In F2:

    =IF(E2="","",INDEX(D:D,MATCH(1,(A:A=A2)*(C:C=MAXIFS(C:C,A:A,A2)),0)))

    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.

  8. #8
    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,410

    Re: Identify the higest value and sum across groups

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  9. #9
    Registered User
    Join Date
    12-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Identify the higest value and sum across groups

    Getting an error. Not sure the issue. Attached is the revised file with formula
    Attached Files Attached Files

  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,410

    Re: Identify the higest value and sum across groups

    Drag copy the formula in F2 down again, then it will work.

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    G
    1
    Name Subject Marks Category Total Marks Highest Scored Category TEST
    2
    Alex Physics
    35
    PHY
    85
    3
    Alex Physics Practical
    45
    PHY PRA
    85
    4
    Alex English
    85
    ENG
    165
    ENG
    85
    5
    Bob Physics
    45
    PHY
    45
    6
    Bob Physics Practical
    25
    PHY PRA
    70
    PHY
    45
    7
    Kim Math
    35
    MTH
    78
    8
    Kim Chemistry
    56
    CHEM
    78
    9
    Kim Chemistry Practical
    45
    CHEM PRA
    78
    10
    Kim English
    78
    ENG
    214
    ENG
    78
    Sheet: Sheet1

  11. #11
    Registered User
    Join Date
    12-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Identify the higest value and sum across groups

    Not working sorry. Mine is Excel 2016 (Windows) 64 bit - Would it create issues?

  12. #12
    Registered User
    Join Date
    12-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Identify the higest value and sum across groups

    Can you attach the your file please?

  13. #13
    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,410

    Re: Identify the higest value and sum across groups

    I am using YOUR file. Have you done what I suggested? On YOUR file, it puts the problem right. I am on the same Windows platform and Excel version.
    Attached Files Attached Files
    Last edited by AliGW; 04-11-2017 at 10:54 AM.

  14. #14
    Registered User
    Join Date
    12-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Identify the higest value and sum across groups

    Okay, when I open your file I can see it worked but when I do F2 in any cell where the formula kept OR when I drag the formula it generates an error. I followed all your steps. Looks like an error from my side. I will take a look. Thanks for your patience and time. Really appreciate it!!

  15. #15
    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,410

    Re: Identify the higest value and sum across groups

    Do you have calculation set to manual by any chance?

    Glad to have helped, anyway.

  16. #16
    Registered User
    Join Date
    12-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Identify the higest value and sum across groups

    No it's automatic

+ 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. Looking for a VBA or method that will identify if groups of data contain a value
    By oxfordshire23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2017, 12:16 PM
  2. [SOLVED] VBA to find row position of the Higest value
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-25-2015, 06:03 AM
  3. [SOLVED] Identify duplicate groups of cell in column
    By ids in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-24-2014, 09:33 AM
  4. [SOLVED] return a value with the higest frequency
    By tantcu in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-10-2014, 08:55 PM
  5. Replies: 1
    Last Post: 09-02-2013, 06:27 AM
  6. [SOLVED] How to identify those names shared by two groups and do a sum-up?
    By zjianguk in forum Excel General
    Replies: 5
    Last Post: 03-14-2013, 12:53 PM
  7. identify earliest & latest date groups in table
    By Brontosaurus in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 07-19-2011, 04:26 PM

Tags for this Thread

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