Find Second largest value in an Maxifs function

Tomjoh92

New Member
Joined
Jan 24, 2018
Messages
4
Hi!

I need some help. I want to find the second largest value in an MAXIFS function. My Maxifs function only returns the highest.

I've tried to use the large function around the maxifs but it didnt work. Any suggestions?

Thanks for helping!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Something like this


Excel 2010
ABCDE
1namenumberbeth
2Rick199largest
3Bob28second largest
4Beth996thrid
5Bart41forth
6Jim5
7Beth6
8Rick7
9Beth8
10Beth1
Sheet1
Cell Formulas
RangeFormula
D2{=LARGE(IF($D$1=$A$2:$A$10,$B$2:$B$10),1)}
D3{=LARGE(IF($D$1=$A$2:$A$10,$B$2:$B$10),2)}
D4{=LARGE(IF($D$1=$A$2:$A$10,$B$2:$B$10),3)}
D5{=LARGE(IF($D$1=$A$2:$A$10,$B$2:$B$10),4)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
J
1
Sort.Nr
K
Navn
L
Volum
2 1400301
3 2400150
4 1020200
5 200050

<colgroup><col><col><col></colgroup><tbody>
</tbody>

Here is the data simplified.
I want to find the second highest value in colume L when colume J not contains 100,101,102,103,104,105,106,107,108,109,110,197,200,202,297.

In dataset above, i want the output to be 150, since J4 is 102.


I really appreciate all the help. Been cracking my brains out over this.
 
Upvote 0
I want to find the second highest value in colume L when colume J not contains 100,101,102,103,104,105,106,107,108,109,110,197,200,202,297.

Hi, welcome to the forum!

How about something like this..:


Excel 2013/2016
JKLMN
1Sort.NrNavnVolum
21400301150
32400150
41020200
5200050
Sheet1
Cell Formulas
RangeFormula
N2=AGGREGATE(14,6,(L2:L5)/(1-ISNUMBER(MATCH(J2:J5,{100,101,102,103,104,105,106,107,108,109,110,197,200,202,297},0))),2)
 
Upvote 0
Just to add to what FormR posted if you want the largest, 2nd largest, 3rd largest... then you can use rows for the k value so that it increments as you drag it down.

Code:
=IFERROR(AGGREGATE(14,6,($L$2:$L$5)/(1-ISNUMBER(MATCH($J$2:$J$5,$Q$2:$Q$16,0))),ROWS(H$2:H2)),"")
 
Last edited:
Upvote 0
Thanks a lot!!

This worked fine. Had to make a list with the numbers since the {} syntax didnt work in Norwegian Excel.
 
Upvote 0
Great, glad it worked :)

Had to make a list with the numbers since the {} syntax didnt work in Norwegian Excel.

It's arguably better to list the numbers on the sheet anyway but if you really wanted to use the array constant you could try one of these instead.

{100;101;102;103;104;105;106;107;108;109;110;197;200;202;297}
Or
{100\101\102\103\104\105\106\107\108\109\110\197\200\202\297}
 
Upvote 0
Great, glad it worked :)



It's arguably better to list the numbers on the sheet anyway but if you really wanted to use the array constant you could try one of these instead.

{100;101;102;103;104;105;106;107;108;109;110;197;200;202;297}
Or
{100\101\102\103\104\105\106\107\108\109\110\197\200\202\297}


Thank you!
Second alternative worked!
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,720
Members
448,986
Latest member
andreguerra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top