Power Query IF Function combined with NETWORKDAYS.INTL

jajatidev

Board Regular
Joined
Jul 29, 2016
Messages
78
Office Version
  1. 365
Platform
  1. Windows
Hi,
Need guidance.

My Table has two date columns StartDate and EndDate with some blank EndDate cells. I'm trying to create a custom column to populate the blank cells with the following logic;

If EndDate is not null then EndDate else StartDate + 2 workdays excluding weekends and holidays.

I'm able to exceute the if statement. however unable to define the statement to exclude weekends and holidays. shared below is the list of holidays.
Please advise how to execute the logic in M Language.

Date
01/01/2022
01/17/2022
02/21/2022
05/30/2022
07/04/2022
09/05/2022
10/10/2022
11/11/2022
11/24/2022
12/25/2022
01/01/2023
01/16/2023
02/20/2023
05/29/2023
07/04/2023
09/04/2023
10/09/2023
11/11/2023
11/23/2023
12/25/2023
01/01/2024
01/15/2024
02/19/2024
05/27/2024
07/04/2024
09/02/2024
10/14/2024
11/11/2024
11/28/2024
12/25/2024
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,221,444
Messages
6,159,912
Members
451,601
Latest member
terrynelson55

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top