Find same date
I have an employee request for time off sheet. One column has the date the employee has requested off, another has the date the employee is set to return to work and a third column is "Other Employees off at the same time." Is there a formula that will search the entire sheet of dates of leave and dates of return to let me know who else is going to be off during that same time frame?
Best Answers
-
Try somethign like this:
=IF(COUNTIFS([Leave Date]:[Leave Date], @cell <= [Return Date]@row, [Return Date]:[Return Date], @cell >= [Leave Date]@row) > 1, 1)
This will output a 1 on any rows that have overlapping dates.
-
You can use a JOIN/COLLECT for that.
=IF(COUNTIFS([Leave Date]:[Leave Date], @cell <= [Return Date]@row, [Return Date]:[Return Date], @cell >= [Leave Date]@row) > 1, JOIN(COLLECT([Name Column]:[Name Column], [Leave Date]:[Leave Date], @cell <= [Return Date]@row, [Return Date]:[Return Date], @cell >= [Leave Date]@row), ", "))
Answers
-
Try somethign like this:
=IF(COUNTIFS([Leave Date]:[Leave Date], @cell <= [Return Date]@row, [Return Date]:[Return Date], @cell >= [Leave Date]@row) > 1, 1)
This will output a 1 on any rows that have overlapping dates.
-
That certainly helps! Thank you! I at least now know to look for another employee. It would be ideal if it would populate the name of the other employee that shares the same dates but this does help. Thank you!
-
You can use a JOIN/COLLECT for that.
=IF(COUNTIFS([Leave Date]:[Leave Date], @cell <= [Return Date]@row, [Return Date]:[Return Date], @cell >= [Leave Date]@row) > 1, JOIN(COLLECT([Name Column]:[Name Column], [Leave Date]:[Leave Date], @cell <= [Return Date]@row, [Return Date]:[Return Date], @cell >= [Leave Date]@row), ", "))
-
@Paul Newcome That is perfect! Thank you very much!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!