Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the first and second maximum number?

I am trying to find first highest number and second highest number in excel. What shall i do for that. I did not find the right formula.

Note: I have already used the large and max formula.

=LARGE(E4:E9;1) 

edit: guys I know if i write 2 instead of 1 i will get the result but i have to click the mouse to see all result.

like image 483
user2957394 Avatar asked Nov 15 '13 22:11

user2957394


People also ask

How do you find the second highest element?

The simple approach to find second largest element in array can be running two loops. The first loop will find the first largest element in the array. After that, the second loop will find the largest element present in the array which is smaller than first_largest.

How do you find the maximum element?

To find the largest element, the first two elements of array are checked and the largest of these two elements are placed in arr[0] the first and third elements are checked and largest of these two elements is placed in arr[0] . this process continues until the first and last elements are checked.


2 Answers

If you want the second highest number you can use

=LARGE(E4:E9;2)

although that doesn't account for duplicates so you could get the same result as the Max

If you want the largest number that is smaller than the maximum number you can use this version

=LARGE(E4:E9;COUNTIF(E4:E9;MAX(E4:E9))+1)

like image 176
barry houdini Avatar answered Oct 05 '22 04:10

barry houdini


OK I found it.

=LARGE($E$4:$E$9;A12)

=large(array, k)

Array Required. The array or range of data for which you want to determine the k-th largest value.

K Required. The position (from the largest) in the array or cell range of data to return.

like image 30
user2957394 Avatar answered Oct 05 '22 05:10

user2957394