ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Want to Improve Formula (https://www.excelbanter.com/excel-worksheet-functions/451221-want-improve-formula.html)

tb

Want to Improve Formula
 
I managed to create the following formula:

=IF(AND(J3<"",L3<""),IF(L3="air",IF(WEEKDAY(J3+[15import.xlsx]Sheet2!$
A$2,2)<6,J3+[15import.xlsx]Sheet2!$A$2,WORKDAY(J3+[15import.xlsx]Sheet2!
$A$2,1)),IF(L3="dhl",IF(WEEKDAY(J3+[15import.xlsx]Sheet2!$B$2,2)<6,J3+[1
5import.xlsx]Sheet2!$B$2,WORKDAY(J3+[15import.xlsx]Sheet2!$B$2,1)),IF(L3
="ups",IF(WEEKDAY(J3+[15import.xlsx]Sheet2!$C$2,2)<6,J3+[15import.xlsx]S
heet2!$C$2,WORKDAY(J3+[15import.xlsx]Sheet2!$C$2,1)),IF(L3="ocean",IF(WE
EKDAY(J3+[15import.xlsx]Sheet2!$D$2,2)<6,J3+[15import.xlsx]Sheet2!$D$2,W
ORKDAY(J3+[15import.xlsx]Sheet2!$D$2,1)))))),"")

Which basically calculates delivery dates for products that I purchase.
If a delivery date falls on a weekend, the formula automatically
adjusts the delivery date to the next available Monday.

The formula does its basic job but I would like to improve things.
While the formula can detect if a delivery date falls on a weekend, it
cannot detect if it falls on any other type of company holiday which
falls on a weekday. (For instance, Christmas this year falls on a
Friday.)

Common sense tells me that I need to create some sort of Excel table
that includes all the company holidays that fall on a weekday, but how
would I integrate that to the existing formula?

Thanks.
--
tb


All times are GMT +1. The time now is 08:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com