Row of the Second Largest Number

chris000

New Member
Joined
Jun 6, 2015
Messages
1
Hi,

I have an array in cell A1:A6 with integers. Some of the number have duplicates. How can I know the row number of the second largest number if the first largest number and the second largest number are the same?

for example, I have
A1: 2
A2: 5
A3: 5
A4: 2
A5: 1

if I use match and large,
= MATCH(LARGE(A1:A6,1),A1:A6,0) = 2
= MATCH(LARGE(A1:A6,2),A1:A6,0) = 2, this should return 3.


Thank you very much
 

Some videos you may like

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
Control+shift+enter, not just enter:

=SMALL(IF(A1:A5=LARGE(A1:A5,2),ROW(A1:A5)),COUNTIF(A1:A5,LARGE(A1:A5,2)))
 

MarcelBeug

Well-known Member
Joined
Apr 25, 2014
Messages
1,811
Aladin, I guess you mean ;)

Code:
=SMALL(IF(A1:A5=LARGE(A1:A5,2),ROW(A1:A5)),[B][COLOR="#FF0000"]2-[/COLOR][/B]COUNTIF(A1:A5,[B][COLOR="#FF0000"]">"&[/COLOR][/B]LARGE(A1:A5,2)))
 

Watch MrExcel Video

Forum statistics

Threads
1,122,499
Messages
5,596,515
Members
414,074
Latest member
Matthew Kakde

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
Top