How can I find the last instance of each unique item (in column), display only those columns?

fitzchivalry

New Member
Joined
Mar 23, 2015
Messages
33
I have a spreadsheet as follows:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Customer[/TD]
[TD]Order Detail[/TD]
[TD]Order ID[/TD]
[/TR]
[TR]
[TD]01/01/2015[/TD]
[TD]John[/TD]
[TD]Eggs[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]02/01/2015[/TD]
[TD]Simon[/TD]
[TD]Beans[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]03/01/2015[/TD]
[TD]Anna[/TD]
[TD]Toast[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]04/01/2015[/TD]
[TD]Sinead[/TD]
[TD]Toast[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]05/01/2015[/TD]
[TD]Andrew[/TD]
[TD]Toast[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]06/01/2015[/TD]
[TD]Caroline[/TD]
[TD]Eggs[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]07/01/2015[/TD]
[TD]Bill[/TD]
[TD]Sausages[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]08/01/2015[/TD]
[TD]Leanne[/TD]
[TD]Mushrooms[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]09/01/2015[/TD]
[TD]Mike[/TD]
[TD]Toast[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]10/01/2015[/TD]
[TD]Sarah[/TD]
[TD]Tea[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]01/02/2015[/TD]
[TD]Nicholas[/TD]
[TD]Sausages[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]02/02/2015[/TD]
[TD]John[/TD]
[TD]Bacon[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]03/02/2015[/TD]
[TD]Mike[/TD]
[TD]Sausages[/TD]
[TD]13[/TD]
[/TR]
[TR]
[TD]04/02/2015[/TD]
[TD]Sinead[/TD]
[TD]Eggs[/TD]
[TD]14[/TD]
[/TR]
[TR]
[TD]05/02/2015[/TD]
[TD]Leanne[/TD]
[TD]Sausages[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]06/02/2015[/TD]
[TD]Bill[/TD]
[TD]Eggs[/TD]
[TD]16[/TD]
[/TR]
[TR]
[TD]07/02/2015[/TD]
[TD]Simon[/TD]
[TD]Toast[/TD]
[TD]17[/TD]
[/TR]
[TR]
[TD]08/02/2015[/TD]
[TD]John[/TD]
[TD]Eggs[/TD]
[TD]18[/TD]
[/TR]
[TR]
[TD]09/02/2015[/TD]
[TD]Anna[/TD]
[TD]Sausages[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]10/02/2015[/TD]
[TD]Anna[/TD]
[TD]Toast[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]01/03/2015[/TD]
[TD]Mike[/TD]
[TD]Sausages[/TD]
[TD]21[/TD]
[/TR]
[TR]
[TD]02/03/2015[/TD]
[TD]Sinead[/TD]
[TD]Sausages[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD]03/03/2015[/TD]
[TD]Peter[/TD]
[TD]Eggs[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]04/03/2015[/TD]
[TD]Gabi[/TD]
[TD]:)[/TD]
[TD]24[/TD]
[/TR]
[TR]
[TD]05/03/2015[/TD]
[TD]Mohammed[/TD]
[TD]Sausages[/TD]
[TD]25[/TD]
[/TR]
[TR]
[TD]06/03/2015[/TD]
[TD]Karen[/TD]
[TD]Toast[/TD]
[TD]26[/TD]
[/TR]
[TR]
[TD]07/03/2015[/TD]
[TD]John[/TD]
[TD]Mushrooms[/TD]
[TD]27[/TD]
[/TR]
[TR]
[TD]08/03/2015[/TD]
[TD]Leanne[/TD]
[TD]Mushrooms[/TD]
[TD]28[/TD]
[/TR]
[TR]
[TD]09/03/2015[/TD]
[TD]Peter[/TD]
[TD]Eggs[/TD]
[TD]29[/TD]
[/TR]
</tbody>[/TABLE]

Didn't really need that 3rd column. Anyway.

I have a spreadsheet like this and would like to somehow pull just the last mention of each Customer, so I can see when they last ordered, and display these in another table, which could be called most recent order.

Would it require scripting or can this be done with VLOOKUP or something? I'm going to carry on looking for a solution, but this isn't my area of expertise.

I'm continuing to try and figure this out myself, but am a bit stuck so hoping to be pointed in the right direction.

Am currently looking up how to find unique values, thinking that might be the first step.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
assuming you have a list of unique customers already than

=LOOKUP(2,1/($B$2:$B$30=F2),$A$2:$A$30)

where column B are the customers and column A are the dates.

F2 would hold the first unique customers name.
 
Upvote 0
Thank you, sorry for my ridiculously late response.

I read your reply not long after you posted it, and tried to get the same to work in OpenOffice, to no avail. I just get =DIV/0.

I didn't mention I'm using OpenOffice before because for my reasoning, that's my problem and this is an Excel forum not OpenOffice forum.

=INDEX(A1:A100,MATCH(A1,D1:D100,0))

Along with some instructions to goto the sheet in question and make sure each row has a corresponding number, then sort descending, come back to the sheet I'm using that formula on and sort the results descending. And then press Ctrl+Z until the sheet containing the data is back in the correct order.

Suggestions welcome, I've given up trying to make this better on my own (I've tried stuff involving IFERROR, MAX, IF, INDEX, LOOKUP, today, and this is the closest I've gotten. I remember doing something else weeks ago that worked better than my current solution, but I can't remember what it was and I still had to reverse the order of the cells manually!).
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,025
Members
452,542
Latest member
Bricklin

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