Hi,
I'm trying to write a formula in Column E on the Inactives sheet to retrieve the record from the Returns sheet with the next closest "Start Date" that is after the "End Date" on the Inactives sheet.
So ideally for Employee 123, I would populate "2/15/2021" in Cell E2 in the Inactives sheet and "1/28/2021" in Cell E3 in the Inactives sheet.
I tried doing this by creating a unique instance of each record as I have multiple Employee records with varying start and end dates on both sheets. In a normal circumstance, the (End Date - 1) on the Inactives sheet will match the Start Date on the Returns sheet, so my Unique columns match values. So either of these work for the normal circumstance:
=INDEX(Returns!E:E,MATCH(Inactives!H2,Returns!G:G,0))
or =XLOOKUP(H2,Returns!G:G,Returns!E:E,0)
But I can't seem to find anything that makes sense to me in order to retrieve record with the next closest date that is not exact. I tried doing something like this but this isn't making sense: =INDEX(Returns!E:E,MATCH(MIN(ABS(Inactives!H16-Returns!E25)),0))
I'm trying to write a formula in Column E on the Inactives sheet to retrieve the record from the Returns sheet with the next closest "Start Date" that is after the "End Date" on the Inactives sheet.
So ideally for Employee 123, I would populate "2/15/2021" in Cell E2 in the Inactives sheet and "1/28/2021" in Cell E3 in the Inactives sheet.
I tried doing this by creating a unique instance of each record as I have multiple Employee records with varying start and end dates on both sheets. In a normal circumstance, the (End Date - 1) on the Inactives sheet will match the Start Date on the Returns sheet, so my Unique columns match values. So either of these work for the normal circumstance:
=INDEX(Returns!E:E,MATCH(Inactives!H2,Returns!G:G,0))
or =XLOOKUP(H2,Returns!G:G,Returns!E:E,0)
But I can't seem to find anything that makes sense to me in order to retrieve record with the next closest date that is not exact. I tried doing something like this but this isn't making sense: =INDEX(Returns!E:E,MATCH(MIN(ABS(Inactives!H16-Returns!E25)),0))