Picking out 2nd, 3rd etc highest values

Corleone

Well-known Member
Joined
Feb 2, 2003
Messages
841
Office Version
  1. 365
Hi

Im currently using this formula below to pick out the 1st/2nd/3rd/4th etc latest Activity dates when a criteria is met in the source data (changing the 3 at the end as required)

The Match is in Column A and the dates are being picked up from column C (The example below is looking for matches to Activity 1)
The results are then placed in column F (rows 2 down to 11) as it is looking for the latest 10 dates

{=INDEX($C$2:$C$11,SMALL(IF($F$1=$A$2:$A$11,ROW($A$2:$A$11)-ROW($A$2)+1),3)}

How would i get the corresponding activity description from column B to appear in column E.
would i need to create some form of an offset command based on the above formula?

Im using Excel Office 365

Thanks
1644998168769.png
 
Last edited:

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi Corleone

If you altered the formula in F2 to {=INDEX($C$2:$C$11,SMALL(IF($F$1=$A$2:$A$11,ROW($A$2:$A$11)-ROW($A$2)+1),ROW(1:1)))}

Does this work, for what you want?

And in E2 {=INDEX(B:B,MATCH($F$1&$F2,A:A&C:C,0))}

Regards

Ian
 
Upvote 0
Solution
try this

Book1
ABCDEFG
1Activity 2
2Activity 1D122/02/2022Activity 2D304/03/2022
3Activity 1D227/02/2022Activity 2D514/03/2022
4Activity 2D304/03/2022Activity 2D724/03/2022
5Activity 1D409/03/2022
6Activity 2D514/03/2022
7Activity 1D619/03/2022
8Activity 2D724/03/2022`
9Activity 3D829/03/2022
10Activity 3D903/04/2022
11Activity 3D1008/04/2022
Sheet1
Cell Formulas
RangeFormula
E2:G4E2=FILTER(A2:C11,(C2:C11<=SMALL(IF(A2:A11=E1,C2:C11),3))*(A2:A11=E1))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
E1List=$A$7:$A$9
 
Upvote 0
Cell Formulas
RangeFormula
E2:F6E2=SORT(FILTER(Tabel1[[description]:[qty]],Tabel1[product]="Activity 1","empty"),2,1)
A2:A22A2="Activity " & MOD(ROW(),4)+1
C3:C22C3=+C2+1
Dynamic array formulas.
 
Upvote 0
Hi Corleone

If you altered the formula in F2 to {=INDEX($C$2:$C$11,SMALL(IF($F$1=$A$2:$A$11,ROW($A$2:$A$11)-ROW($A$2)+1),ROW(1:1)))}

Does this work, for what you want?

And in E2 {=INDEX(B:B,MATCH($F$1&$F2,A:A&C:C,0))}

Regards

Ian
This works a treat - Many thanks
I havent tried the to other 2 options ,though im sure they work just as well
Thanks all for the responses
 
Upvote 0
A slight issue i have still is that if there is more than 1 activity with the same date - It returns the first Activity Description for all of them

1645009905876.png
 
Upvote 0
I havent tried the to other 2 options ,though im sure they work just as well
mrexcel (1).xlsx
ABCDEFG
1productdescriptionqtydescription activity
2Activity 3a16/02/2022c16/02/2022
3Activity 4b16/02/2022g16/02/2022
4Activity 1c16/02/2022k16/02/2022
5Activity 2d16/02/2022m16/02/2022
6Activity 3e16/02/2022m16/02/2022
7Activity 4f16/02/2022
8Activity 1g16/02/2022
9Activity 2h16/02/2022
10Activity 3i16/02/2022
11Activity 4j16/02/2022
12Activity 1k16/02/2022
13Activity 2l16/02/2022
14Activity 3m16/02/2022
15Activity 4m16/02/2022
16Activity 1m16/02/2022
17Activity 2m16/02/2022
18Activity 3m16/02/2022
19Activity 4m16/02/2022
20Activity 1m16/02/2022
21Activity 2m16/02/2022
22Activity 3m16/02/2022
Blad1
Cell Formulas
RangeFormula
E2:F6E2=SORT(FILTER(Tabel2[[description]:[qty]],Tabel2[product]="Activity 1","empty"),2,1)
A2:A22A2="Activity " & MOD(ROW(),4)+1
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,859
Messages
6,121,963
Members
449,059
Latest member
oculus

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