Vlookup to pull reults of latest date

sheller

New Member
Joined
Dec 12, 2016
Messages
22
Hi there,
I have a vlookup to pull in sample results, but occasionally we will have the same P# with multiple results, and I only would like to pull in column G (Sample Status) from the latest result if there are multiple samples with the same P#. Any suggestions? My current Vlookup is as follows (column O in another worksheet lists P#).
In the example below, I would want the vlookup to show "Requested Pending Result" (since it was the latest "recevied date" until we have a date in colunmn F, and then to pull in column G once we have a result date. Would this be possible?

=IFERROR(IF(VLOOKUP(O:O,SAMPLES!A:F,6,0)="","Requested Pending Result",VLOOKUP(O:O,SAMPLES!A:G,7,0))," ")


[TABLE="width: 843"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD]FORMATTED_PO[/TD]
[TD]SAMPLE_NO[/TD]
[TD]SMPL_DESC[/TD]
[TD]REQ_DATE[/TD]
[TD]RCVD_DATE[/TD]
[TD]RESULT_DATE[/TD]
[TD]SAMPLE_STATUS[/TD]
[/TR]
[TR]
[TD]P-8857-A[/TD]
[TD]33764[/TD]
[TD]Arrival Samples[/TD]
[TD]7/5/2018[/TD]
[TD]7/9/2018[/TD]
[TD][/TD]
[TD]PENDING[/TD]
[/TR]
[TR]
[TD]P-8857-A[/TD]
[TD]33751[/TD]
[TD]Arrival Samples[/TD]
[TD]6/28/2018[/TD]
[TD]7/3/2018[/TD]
[TD]7/5/2018 0:00[/TD]
[TD]REJECTED[/TD]
[/TR]
[TR]
[TD]P-8857-A[/TD]
[TD]33750[/TD]
[TD]Arrival Samples[/TD]
[TD]6/28/2018[/TD]
[TD]7/3/2018[/TD]
[TD]7/5/2018 0:00[/TD]
[TD]REJECTED[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,225,757
Messages
6,186,850
Members
453,379
Latest member
gabriellegonzalez

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