I have this formula that calculates days off for employees, ommitting weekends.…
- User
I have this formula that calculates days off for employees, ommitting weekends. =IF(B4="h", NETWORKDAYS(A4, F4)-1, "") The formula works accurately. However, it does not take into account Public Holidays
I have dates of Public holidays listed in the range AL3:AL26 Is there a way to write a formula that can check if any of the dates in AL3:AL46 fall within the Leave start date in Column A and the end leave date in column F and deduct the number of days found from the final result.
I could add a helper column in AM if you can give me a formula that will check if any date in AL3:AL26 falls within dates enetered in column A and F and output the number of dates found.
- Assistant
Certainly! To achieve your goal, I'll provide you with a formula to put into a helper column (let's say you want to use column AM) that will count the number of public holidays in the range AL3:AL26 that fall between the start date in Column A and the end date in Column F.
In cell AM4, you can use the following array formula:
=SUMPRODUCT(--(AL$3:AL$26 >= A4), --(AL$3:AL$26 <= F4))Explanation:
AL$3:AL$26 >= A4checks each holiday date to see if it is greater than or equal to the start date.AL$3:AL$26 <= F4checks each holiday date to see if it is less than or equal to the end date.- The double negative converts the TRUE/FALSE results into 1s and 0s.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.