Home > Back-end >  Google sheets. How calculate sum of three max values in a row?
Google sheets. How calculate sum of three max values in a row?

Time:12-20

I have the values in a row:

14 5 10 1 14 18

I need to take three max values (in the case it is 14 14 18) and calcualte their sum. Can anybody help me how write a formula?

I didn't find precise formala for that. Maybe some formala's combianation is requred here.

CodePudding user response:

Try

=SUM(SORTN(FLATTEN(A1:F1),3,,1,0))

For Excel, try-

=SUM(INDEX(SORT(TRANSPOSE(A1:F1),1,-1),SEQUENCE(3)))

With most recent version, use-

=SUM(TAKE(SORT(TOCOL(A1:F1),1,-1),3))

enter image description here

CodePudding user response:

Alternative:

=SUMPRODUCT(LARGE(A1:F1,{1,2,3}))

Or:

=INDEX(SUM(LARGE(A1:F1,{1,2,3})))
  • Related