I have a list of 20,000 employs with a store number and their join and end date.
On another sheet I have a list of managers, with their end date.
What I need to do is have a spreadsheet that will list the managers name, with and end date, and I need to know every member of staff that worked there on their last day.
So, on the date the manager leaves, the staff member must have started that day or before, and still be at the store, or have left on or after the day the manager leaves.
The results could turn up 1 employee or 20 employees.
I hope my example in output makes sense (and the dates match up as they should do!!)
Employee List
Output
On another sheet I have a list of managers, with their end date.
What I need to do is have a spreadsheet that will list the managers name, with and end date, and I need to know every member of staff that worked there on their last day.
So, on the date the manager leaves, the staff member must have started that day or before, and still be at the store, or have left on or after the day the manager leaves.
The results could turn up 1 employee or 20 employees.
I hope my example in output makes sense (and the dates match up as they should do!!)
Employee List
A1- Employee Number | B1 - Employee Name | C1 - Store Number | D1 - Start Date | E1 - End Date |
001 | Richard | 1000 | 31/01/2024 | 31/12/9999 |
002 | James | 1000 | 01/05/2024 | 31/12/9999 |
003 | Jeremy | 1000 | 28/01/2024 | 05/06/2024 |
004 | Steve | 1000 | 04/02/2023 | 12/12/2023 |
005 | Katie | 1001 | 01/01/2023 | 31/12/9999 |
006 | Olivia | 1002 | 01/02/2023 | 28/02/2023 |
007 | Laila | 1002 | 14/03/2024 | 31/12/9999 |
008 | Ellie | 1002 | 01/01/2023 | 14/03/2023 |
009 | Jimmy | 1002 | 01/01/2023 | 16/03/2023 |
Output
A1 - Manager Name | B1 - Manager Store | C1 - Manager Leave Date | D1 - Employee 1 | E1 - Employee 2 | F1 - Employee 3 | G1 - Employee 4 |
Andy | 1000 | 02/05/2024 | Richard | James | Jeremy | |
Lee | 1002 | 15/03/2023 | Laila | Jimmy | ||