Networkdays Result

kumara_faith

Well-known Member
Hi,

I have the following table:

Excel Workbook
BCDEF
2M1M2M3*Desired Result
307/19/1007/25/1007/25/10*5
406/27/1007/01/1007/02/10*4
506/28/10*07/05/10*5
607/13/1007/21/1007/20/10*5
Sheet1

I need to build a formula in column F for the following criteria:

1) If M2 is same as M3, then use networkdays to calculate the difference of days from M1 to M3. ( M1 is the start date and M3 is the end date)
2) If M2 is less than M3, then deduct 1 day from the result of networkdays from M1 to M3.( M1 is the start date and M3 is the end date)
3) If M2 is empty, then use networkdays to calculate the difference of days from M1 to M3. ( M1 is the start date and M3 is the end date)
4) If M2 is more than M3, then use networkdays to calculate the difference of days from M1 to M3. ( M1 is the start date and M3 is the end date)

The desired result is stated in column F.

Appreciate assistance.

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

bump.

prabby25101981

Active Member
Considering that the outcome of condition 1, 2, and 4 is the same, here's the formula -

=IF(OR(B3>=C3,ISBLANK(B3)),NETWORKDAYS(A3,C3),NETWORKDAYS(A3,C3)-1)

Does this help ?

barry houdini

MrExcel MVP
Try

=NETWORKDAYS(B3,D3)-(C3< D3)*(C3<><D3)*(C3<>"")

kumara_faith

Well-known Member
barry / prabby,

Thank you both for the suggested solutions. Both worked !

Appreciate your valuable time, effort and patience !

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,168,112
Messages
5,857,450
Members
431,880
Latest member
kar2rost

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.

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

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