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
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Control+shift+enter, not just enter:

=SMALL(IF(A1:A5=LARGE(A1:A5,2),ROW(A1:A5)),COUNTIF(A1:A5,LARGE(A1:A5,2)))
 
Upvote 0
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)))
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,986
Members
448,538
Latest member
alex78

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