Excel cells maximum sum

2024-05-08T21:45:29.8733333+00:00
Good evening to all,

In excel in cells F8:F9 we have the numbers 17 and 11 respectively (sum 28), in cells M8:M9 we have the numbers 14 and 9 respectively (sum 23) and in cells T8:T9 we have the numbers 17 and 14 respectively (sum 31). I am looking for the formula that will display the maximum number by summing these cells. In our case it should display the number 31 as cells T8:T9 have the maximum sum.
 Also the formula that will display the second largest number by summing these cells. In our case it should display the number 28 as cells F8:F9 have the second largest sum.

Then I look for the formula with which, if the sum between cells F8:F9 and M8:M9 and T8:T9 with the same elements as before (in our case cells T8:T9 have the maximum sum again) then let us returns the value of cell S1, if cells F8:F9 had the largest sum return the value of cell E1 and if cells M8:M9 had the largest sum return the value of cell L1.
 Again here I am looking for the formula that will return me the second largest sum (the 28 in cells F8:F9) so it returns the value of cell E1 and so on.


Thanks in advance


Postscript : I have already tried these formulas unsuccesful
 
=IF(SUM(F8:F9)=MAX(F8:F9;M8:M9;T8:T9);SUM(F8:F9);IF(SUM(M8:M9)=MAX(F8:F9;M8:M9;T8:T9);SUM(M8:M9)=MAX(F8:F9;M8:M9;T8:T9);SUM(T8:T9)))

And

=MAX(SUM(F8:F9);SUM(M8:M9);SUM(T8:T9))

And

=MAX(SUMPRODUCT(F8:F9;{1;1});SUMPRODUCT(M8:M9; {1;1});SUMPRODUCT(T8:T9;{1;1}))

Also my operating system use ';' instead of ',' to separate cells
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,947 questions
Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,725 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Andrew Wathana Hosakul 0 Reputation points
    2024-05-09T05:02:09.4866667+00:00

    Since you only have 3 numbers to evaluate, you can use the MEDIAN to identify the 2nd highest value. And use Min, Max to get the highest and lowest.

    For the final evaluation, you can use the SWITCH(TRUE()... pattern instead of using nested IF statements.

    User's image

     =SWITCH(
         TRUE(),
           SUM($F$8:$F$9)=MAX(SUM($F$8:$F$9),SUM($M$8:$M$9),SUM($T$8:$T$9)),E1,
    
    SUM($M$8:$M$9)=MAX(SUM($F$8:$F$9),SUM($M$8:$M$9),SUM($T$8:$T$9)),L1,
    
          S1)
    

  2. Jiajing Hua-MFST 10,560 Reputation points Microsoft Vendor
    2024-05-09T05:23:33.0533333+00:00

    Hi @Νικόλαος Γιαννέλος

    To get the second largest number by summing these cells, the formula could be

    =LARGE(CHOOSE({1,2,3},SUM(F8:F9),SUM(M8:M9),SUM(T8:T9)),2)

    Then I look for the formula with which, if the sum between cells F8:F9 and M8:M9 and T8:T9 with the same elements as before

    I am a little confused about it, I will provide following formulas first:

    The second largest number: =INDEX(CHOOSE({1,2,3},E1,L1,S1),,MATCH(LARGE(CHOOSE({1,2,3},SUM(F8:F9),SUM(M8:M9),SUM(T8:T9)),2),CHOOSE({1,2,3},SUM(F8:F9),SUM(M8:M9),SUM(T8:T9))))

    The first largest number: =INDEX(CHOOSE({1,2,3},E1,L1,S1),,MATCH(LARGE(CHOOSE({1,2,3},SUM(F8:F9),SUM(M8:M9),SUM(T8:T9)),1),CHOOSE({1,2,3},SUM(F8:F9),SUM(M8:M9),SUM(T8:T9))))

    Any misunderstanding, welcome to post back.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



  3. Barry Schwarz 3,071 Reputation points
    2024-05-09T08:30:42.0533333+00:00

    First of all, the formula =MAX(SUM(F$8:F$9),SUM(M$8:M$9),SUM(T$8:T$9)) works fine. I don't know why you had trouble with it. If you are truly limited to only three sums, you could use the MAX, MEDIAN, and MIN function but this will not help with the second half of your objective.

    To solve the general problem, take it in steps:

    • The formula =CHOOSE({1,2,3},SUM(F$8:F$9),SUM(M$8:M$9),SUM(T$8:T$9)) builds an array of the sums. You can expand this to include more than three. Call this textA.
    • The formula =LARGE(textA,1) produces the largest sum. You can change the 1 to get the 2nd, 3rd, etc largest sum. Call this textL.
    • The formula =MATCH(*textL,textA,*0) produces the index number of the largest sum. Again, change the 1 in textL to get the 2nd, 3rd, etc largest. Call this textM.
    • The formula =CHOOSE(*textM,*E1,L1,S1) will produce the value of the cell in row 1 in the column to the left of the largest sum. Again, change the 1 as desired.

    When put all together, you get

    =CHOOSE(MATCH(LARGE(CHOOSE({1,2,3},SUM(F$8:F$9),SUM(M$8:M$9),SUM(T$8:T$9)),1),CHOOSE({1,2,3},SUM(F$8:F$9),SUM(M$8:M$9),SUM(T$8:T$9)),0),E$1,L$1,S$1)


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.