Sep 25 2024 05:35 PM
I am trying to determine if a date range falls within another date range for a specific ID.
Example:
Table1
ID | Start Date | End Date |
1 | 10/9/2022 | 11/19/2022 |
2 | 2/12/2023 | 3/11/2023 |
Table2
ID | Start Date | End Date | Value |
1 | 10/10/2022 | 11/10/2022 | Leave |
2 | 5/5/2024 | 5/21/2024 | Leave |
Expected Result
ID | Result |
1 | Leave |
2 | (blank) |
Sep 25 2024 08:05 PM - edited Sep 25 2024 08:09 PM
@TCatron18 Try the following formula. Download the attached file.
=MAP(A8:A9,LAMBDA(x,IF(COUNTIFS(F2:F10,x,G2:G10,">="&XLOOKUP(x,A2:A5,B2:B5),H2:H10,"<="&XLOOKUP(x,A2:A5,C2:C5))>0,"Leave","")))
Sep 26 2024 08:43 AM
@Harun24HR It seems to work for some but not working for all. I'm not able to attach any documents here yet, but I'll include some screenshots. The highlighted columns are where the formulas are and for the highlighted row/cells I would expect the value to be 'Leave' based on the data in the Leave tab.
Formula in my 'CHECK' columns:
=MAP(A2:A2106,LAMBDA(x,IF(COUNTIFS(Leave!A2:A44850,x,Leave!B2:B44850,">="&XLOOKUP(x,Data!A2:A2106,Data!C2:C2106),Leave!C2:C44850,"<="&XLOOKUP(x,Data!A2:A2106,Data!D2:D2106))>0,"Leave","")))
Sep 26 2024 08:07 PM
Sep 26 2024 10:14 PM - edited Sep 27 2024 08:25 AM
@Harun24HR Here is a link to the document https://docs.google.com/spreadsheets/d/1-sDskQ3eqWqT6xYlmohjm7KdsBJvupyg/edit?usp=sharing&ouid=11319...
I've only done a handful of expected results in this since the dataset is so large, but the orange highlighted rows should be showing 'Leave' in the CHECK# columns.
Sep 30 2024 08:10 AM
SolutionSep 30 2024 08:10 AM
Solution