Finding the Nth largest in non-contiguous range

medelste

New Member
Joined
Jan 26, 2021
Messages
6
Office Version
  1. 2013
Platform
  1. Windows
I have hundreds of rows of data coming in regularly and need an answer too quickly to sort the data first. Can you assist me in coming up with a formula that finds the nth largest number in a range based on criteria in another column? For example, how would I get the the second largest value in the second column only for those rows that contain the word "Apple" in the first column (answer: 7)? I have Excel 365 but may have some colleagues that have older version of Excel.

Apple
5
Banana
3​
Cherry
8​
Orange
5​
Blueberry
0​
Banana
2​
Orange
6​
Apple
9
Orange
1​
Apple
7
Cherry
1​
Cherry
8​
Blueberry
5​
Apple
1
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
in a 2013
-9E99 is a very large negative number, so if you get that, there are no other "apples" found.
Map1
ABCD
1Apple127
25219
3Banana315
4341
5Cherry5-9E+99
686-9E+99
7Orange7-9E+99
858-9E+99
9Blueberry9-9E+99
10010-9E+99
11Banana11-9E+99
12212-9E+99
13Orange13-9E+99
14614-9E+99
15Apple15-9E+99
16916-9E+99
17Orange17-9E+99
18118-9E+99
19Apple19-9E+99
20720-9E+99
21Cherry21-9E+99
22122-9E+99
23Cherry23-9E+99
24824-9E+99
25Blueberry25
26526
27Apple27
28128
Blad1
Cell Formulas
RangeFormula
D1:D24D1=LARGE(IF($A$1:$A$28="apple",$B$1:$B$28,-9E+99),ROW())
B1:B28B1=ROW()
 
Upvote 0
Book1
AB
1Apple5
2Banana3
3Cherry8
4Orange5
5Blueberry0
6Banana2
7Orange6
8Apple9
9Orange1
10Apple7
11Cherry1
12Cherry8
13Blueberry5
14Apple1
15
167
Sheet1
Cell Formulas
RangeFormula
B16B16=AGGREGATE(14,6,$B$1:$B$14/($A$1:$A$14="Apple"),2)
 
Upvote 0
Solution
Thank you both! I tried the AGGREGATE method first and it works so I'm going with it. I appreciate your time and thought on this!
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

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