Filter a list to only return top 2 most recent results?

CamelDCamel

New Member
Joined
Nov 11, 2019
Messages
1
Hi All,

I'm new here, so firstly nice to meet you all!

Trying to work out a way to approach this situation. I have a set of data similar to the following. What I want to do is find a way to only show the 2 most latest (most recent date) for each User. For example:

DateNameValue
01/01/19User 117
02/03/19User 14
13/04/19User 112
01/01/19User 25
02/03/19User 223
13/04/19User 22
18/05/19User 244
01/01/19User 312
02/03/19User 346
01/01/19User 411
02/03/19User 462
13/04/19User 421
18/05/19User 44
01/01/19User 52
02/03/19User 561
13/04/19User 533
18/05/19User 511
20/06/19User 534

<tbody>
</tbody>

As an end result, I was trying to get something like this:

DateNameValue
2/03/19User 14
13/04/19

<tbody>
</tbody>
User 112
13/04/19

<tbody>
</tbody>
User 22
18/05/19

<tbody>
</tbody>
User 244
1/01/19

<tbody>
</tbody>
User 312
2/03/19

<tbody>
</tbody>
User 346
13/04/19

<tbody>
</tbody>
User 421
18/05/19

<tbody>
</tbody>
User 44
18/05/19

<tbody>
</tbody>
User 531
20/06/19

<tbody>
</tbody>
User 534

<tbody>
</tbody>

I thought about putting the data in a pivot table, then sorting the pivot table so the most recent date is always leftmost, then having another sheet that gets the 2 leftmost values with data, however I feel that's probably quite convoluted and there is an easy way.

The data is transnational and will continue to change daily but I only way the last 3 days for each user.

Does anyone have any suggestions on how to approach this?

Thanks in advance!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Welcome to the forum.

This might help you. Copy the A22 and C22 formulas downwards. You will have to populate the B column with the text two of each User. You can hide the helper column with the 2's and the 1's if you like. This will only work if there are no duplicates.

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
Book1
ABCD
1DateNameValue
21/1/2019User 117
33/2/2019User 14
44/13/2019User 112
51/1/2019User 25
63/2/2019User 223
74/13/2019User 22
85/18/2019User 244
91/1/2019User 312
103/2/2019User 346
111/1/2019User 411
123/2/2019User 462
134/13/2019User 421
145/18/2019User 44
151/1/2019User 52
163/2/2019User 561
174/13/2019User 533
185/18/2019User 511
196/20/2019User 534
20
21DateNameValueRecent
223/2/2019User 142
234/13/2019User 1121
244/13/2019User 222
255/18/2019User 2441
261/1/2019User 3122
273/2/2019User 3461
284/13/2019User 4212
295/18/2019User 441
305/18/2019User 5112
316/20/2019User 5341
Sheet47
Cell Formulas
RangeFormula
A22=LARGE(($A$2:$A$19)*($B$2:$B$19=B22),D22)
C22=INDEX($C$2:$C$19,MATCH(A22&B22,$A$2:$A$19&$B$2:$B$19,0))
[/FONT]
 
Upvote 0

Forum statistics

Threads
1,214,395
Messages
6,119,265
Members
448,881
Latest member
Faxgirl

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