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))," ")


ABCDEFG
FORMATTED_POSAMPLE_NOSMPL_DESCREQ_DATERCVD_DATERESULT_DATESAMPLE_STATUS
P-8857-A33764Arrival Samples7/5/20187/9/2018PENDING
P-8857-A33751Arrival Samples6/28/20187/3/20187/5/2018 0:00REJECTED
P-8857-A33750Arrival Samples6/28/20187/3/20187/5/2018 0:00REJECTED

<tbody>
</tbody>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,214,839
Messages
6,121,892
Members
449,058
Latest member
Guy Boot

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