From the below.
worksheet1 : In worksheet1 "duty" column. I need to find out what duty "worker" last had during work_order_date. Bill on work_order_date 08/01/2017 & 08/05/2017 should report back as "welder" because he was not yet a manager until 8/15/2017. worksheet1 Bill work_order_date 09/20/2017 "duty" column should be "manager" because he was last reported as manager in worksheet2 on 8/15. he was not yet an owner until 10/20.
<tbody>
</tbody>
worksheet1 : In worksheet1 "duty" column. I need to find out what duty "worker" last had during work_order_date. Bill on work_order_date 08/01/2017 & 08/05/2017 should report back as "welder" because he was not yet a manager until 8/15/2017. worksheet1 Bill work_order_date 09/20/2017 "duty" column should be "manager" because he was last reported as manager in worksheet2 on 8/15. he was not yet an owner until 10/20.
worksheet1 | worksheet2 | ||||||
worker | work_order_date | duty | worker | employment_date | duty | ||
bill | 08/01/2017 | bill | 07/30/2017 | welder | |||
bill | 08/05/2017 | bill | 08/15/2017 | manager | |||
bill | 09/20/2017 | bill | 10/20/2017 | owner | |||
jan | 10/31/2017 | jan | 11/05/2017 | client |
<tbody>
</tbody>