Pull recent 3 most recent entries

DJFANDANGO

Board Regular
Joined
Mar 31, 2016
Messages
113
Office Version
  1. 365
Platform
  1. Windows
Hi Guys,

I'm going to change my name to brain fart....

I'm trying to figure out how to pull the top 3 or 3 most recent entries from a data set based on the date...

I'm guessing INDEX/MATCH... but can't figure out the 'date' bit... any help appreciated. Thanks.

Book1
ABCDE
1DataLast 3 results
2DateAuditedOutputAudited
323/12/202015/10/2020Yes
407/12/202027/05/2020Yes
515/10/2020Yes14/05/2020Yes
617/09/2020
702/08/2020
808/07/2020
927/05/2020Yes
1025/05/2020
1121/05/2020
1218/05/2020
1314/05/2020Yes
1415/04/2020
1523/02/2020
1610/02/2020
1701/02/2020
1807/12/2019
1926/11/2019
2024/10/2019Yes
2106/10/2019
2210/09/2019
2327/08/2019
2408/08/2019
2513/07/2019Yes
2627/06/2019
2723/05/2019
2829/04/2019
2923/04/2019Yes
3004/03/2019
3124/02/2019
3222/02/2019
3316/02/2019
3417/01/2019
Sheet1
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Perhaps in E3 following array formula
Excel Formula:
 =large((($a$3:$a$34)*--($b$3:$b$34="Yes")),row()-2)
committed with Ctrl+Shift +Enter and pulled down
 
Upvote 0
Hi Arthur,

Thanks, this works pulling the last 3 dates, but it's not pulling the 'Yes" part...? any ideas?
 
Upvote 0
Hi,

Are you able to add additional columns to the file? If yes, you could add 2 additional ones: one (let's assume it's Column C) pulls the date for those rows which contain "Yes" in column B: =IF(B3="Yes",A3,""). Then you could determine the rank of each row where you have a date (i.e. the ones which are audited), using IFERROR and RANK.EQ formulas (let's assume it's in Column D): =IFERROR(RANK.EQ(C3,$C$3:$C$35,0),""). This results in dates being populated to the rows with a "Yes"in the 2nd column. Now you just need to write the INDEX/MATCH formulas to get the 3 most recent dates (since I've inserted columns, it would be in Column F): =INDEX($A$3:$A$35,MATCH(1,$D$3:$D$35,0)). You need to replace 1 with 2 and 3 to return 2nd and 3rd ranked records. If there is a possibility that at any point in time there are less than 3 audited records, you could also combine it with IFERROR.

Hope this helps.
 
Upvote 0
In E3 also committed with CSE
Excel Formula:
=INDEX($B$3:$B$34,match(1,--($b$3:$b$34="Yes")*--($a$3:$a$34=$d3),0))
and pull down
 
Upvote 0
Hi, here's another option you can consider.

Book1
ABCDE
1DataLast 3 results
2DateAuditedOutputAudited
323/12/202015/10/2020Yes
407/12/202015/10/2020Yes
515/10/2020Yes15/10/2020Yes
617/09/2020
702/08/2020
808/07/2020
927/05/2020Yes
1025/05/2020
1121/05/2020
1218/05/2020
1314/05/2020Yes
1415/04/2020
1523/02/2020
1610/02/2020
1701/02/2020
1807/12/2019
1926/11/2019
2024/10/2019Yes
2106/10/2019
2210/09/2019
2327/08/2019
2408/08/2019
2513/07/2019Yes
2627/06/2019
2723/05/2019
2829/04/2019
2923/04/2019Yes
3004/03/2019
3124/02/2019
3222/02/2019
3316/02/2019
3417/01/2019
Sheet1
Cell Formulas
RangeFormula
D3:D5D3=AGGREGATE(14,6,A3:A34/(B3:B34="Yes"),ROWS($D3:D3))
E3:E5E3="Yes"
 
Upvote 0
Hi, here's another option you can consider.

Book1
ABCDE
1DataLast 3 results
2DateAuditedOutputAudited
323/12/202015/10/2020Yes
407/12/202015/10/2020Yes
515/10/2020Yes15/10/2020Yes
617/09/2020
702/08/2020
808/07/2020
927/05/2020Yes
1025/05/2020
1121/05/2020
1218/05/2020
1314/05/2020Yes
1415/04/2020
1523/02/2020
1610/02/2020
1701/02/2020
1807/12/2019
1926/11/2019
2024/10/2019Yes
2106/10/2019
2210/09/2019
2327/08/2019
2408/08/2019
2513/07/2019Yes
2627/06/2019
2723/05/2019
2829/04/2019
2923/04/2019Yes
3004/03/2019
3124/02/2019
3222/02/2019
3316/02/2019
3417/01/2019
Sheet1
Cell Formulas
RangeFormula
D3:D5D3=AGGREGATE(14,6,A3:A34/(B3:B34="Yes"),ROWS($D3:D3))
E3:E5E3="Yes"

Hi FormR,

Thanks for the formula, It's pulling only the most recent date 3 times? any ideas?
 
Upvote 0
Just a little bit change for Top 3 Limitation
IFERROR(AGGREGATE(14,6,$A$2:$A$33/($B$2:$B$33=E2)/(ROWS($D$2:D2)<=3),ROWS(D$2:D2)),"")

Book1
ABCDE
1DateAuditedOutputAudited
223/12/202015/10/2020Yes
307/12/202027/05/2020Yes
415/10/2020Yes14/05/2020Yes
517/09/2020 
602/08/2020 
708/07/2020 
827/05/2020Yes
925/05/2020
1021/05/2020
1118/05/2020
1214/05/2020Yes
1315/04/2020
1423/02/2020
1510/02/2020
1601/02/2020
1707/12/2019
1826/11/2019
1924/10/2019Yes
2006/10/2019
2110/09/2019
2227/08/2019
2308/08/2019
2413/07/2019Yes
2527/06/2019
2623/05/2019
2729/04/2019
2823/04/2019Yes
2904/03/2019
3024/02/2019
3122/02/2019
3216/02/2019
3317/01/2019
Sheet1
Cell Formulas
RangeFormula
D2:D7D2=IFERROR(AGGREGATE(14,6,$A$2:$A$33/($B$2:$B$33=E2)/(ROWS($D$2:D2)<=3),ROWS(D$2:D2)),"")
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,442
Members
449,083
Latest member
Ava19

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