fustilugs3
New Member
- Joined
- Feb 19, 2013
- Messages
- 4
I’m new to this forum, and teaching myself Excel over time, so please forgive me if I’m missing something obvious. I am having trouble with a formula identifying and skipping over holidays. It’s just a piece in a very large template I am creating, but it is crucial that Excel accounts for the holidays. I have the template in Excel 2007 which I can send, but I didn't see an option to attach to the thread. Here is the formula I’m having issues with when calculating the Due Date:
</SPAN>
=IF(B2=TRUE,IF(HOUR(D2)<17,WORKDAY(C2,1,Holidays!A4:A13),IF(HOUR(D2)>=17,WORKDAY(C2,2,Holidays!A4:A13))),IF(HOUR(D2)<17,WORKDAY(C2,5,Holidays!A4:A13),IF(HOUR(D2)>=17,WORKDAY(C2,6,Holidays!A4:A13))))
</SPAN>
B2=TRUE/FALSE (formula result)</SPAN>
C2=Approval Date</SPAN>
D2=Approval Time</SPAN>
The Due Date is based off several factors, which is why the formula is so convoluted. What I’m going for is this:</SPAN>
-If B2 equals TRUE, and the approval time was before 5:00PM, then the Due Date is the approval date plus one day (skipping over weekends and federal bank holidays.)
</SPAN>
-If B2 equals TRUE, and the approval time was at or after 5:00PM, then the Due Date is the approval date plus two days (skipping over weekends and federal bank holidays.)</SPAN>
-If B2 equals FALSE, and the approval time was before 5:00PM, then the Due Date is the approval date plus five days (skipping over weekends and federal bank holidays.)</SPAN>
-If B2 equals FALSE, and the approval time was at or after 5:00PM, then the Due Date is the approval date plus six days (skipping over weekends and federal bank holidays.)</SPAN>
Every portion of the formula seems to be working (no error values and results are correct), except for skipping over holidays. Any ideas on how I can fix this? Thank you for any advice at all!!
EDIT: Should probably mention that all holidays are listed on a separate tab in "=DATE(YYYY,MM,DD)" format.</SPAN>
</SPAN>
=IF(B2=TRUE,IF(HOUR(D2)<17,WORKDAY(C2,1,Holidays!A4:A13),IF(HOUR(D2)>=17,WORKDAY(C2,2,Holidays!A4:A13))),IF(HOUR(D2)<17,WORKDAY(C2,5,Holidays!A4:A13),IF(HOUR(D2)>=17,WORKDAY(C2,6,Holidays!A4:A13))))
</SPAN>
B2=TRUE/FALSE (formula result)</SPAN>
C2=Approval Date</SPAN>
D2=Approval Time</SPAN>
The Due Date is based off several factors, which is why the formula is so convoluted. What I’m going for is this:</SPAN>
-If B2 equals TRUE, and the approval time was before 5:00PM, then the Due Date is the approval date plus one day (skipping over weekends and federal bank holidays.)
</SPAN>
-If B2 equals TRUE, and the approval time was at or after 5:00PM, then the Due Date is the approval date plus two days (skipping over weekends and federal bank holidays.)</SPAN>
-If B2 equals FALSE, and the approval time was before 5:00PM, then the Due Date is the approval date plus five days (skipping over weekends and federal bank holidays.)</SPAN>
-If B2 equals FALSE, and the approval time was at or after 5:00PM, then the Due Date is the approval date plus six days (skipping over weekends and federal bank holidays.)</SPAN>
Every portion of the formula seems to be working (no error values and results are correct), except for skipping over holidays. Any ideas on how I can fix this? Thank you for any advice at all!!
EDIT: Should probably mention that all holidays are listed on a separate tab in "=DATE(YYYY,MM,DD)" format.</SPAN>