# 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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

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 !

1,106,818
Messages
5,513,563
Members
408,959
Latest member
BenBez