Combining NETWORKDAYS with IF, THEN, OR formulas

searchingforhelp

Board Regular
Joined
Nov 11, 2020
Messages
67
Office Version
  1. 365
Platform
  1. Windows
I am having trouble combining formulas and deciphering which formula is best for what is needed. I am currently using the NETWORKDAYS formula, but I cannot connect it with what I am trying to accomplish due to my skill sets.

What I need assistance in is as follows:

1. the formula needs to calculate business days only, excluding weekends.

2. I would need to calculate the days from when the assignment was originally assigned (Column A) to the date when assignment was completed (Column C). However, if there is a reassignment date (column B), have the formula automatically adjust to calculate the reassignment date (Column B) to when the assignment was completed (column C).

3. Lastly, if the reassignment date (Column B) exceeds the assignment completion date, automatically calculate original assigned date (Column A) from when the assignment was completed.

This is where I am stuck. Combining 1,2 and 3 into one formula so I can drag down as more data is entered on the sheet.

Thanking you in advance for any help you can provide.

Example.xlsx
ABCD
1Date when Originally assignedDate when assignment was reassignedDate when assignment was completedNumber of Days
23/10/20213/12/20213
33/10/20213/11/20213/18/20216
43/10/20213/15/20203/11/20212
Sheet1
Cell Formulas
RangeFormula
D2,D4D2=NETWORKDAYS(A2,C2)
D3D3=NETWORKDAYS(B3,C3)
 
How about
Excel Formula:
=IF(OR(B2="",B2>B3),"not applicable","")
Hi Fluff, yes you are correct. That is for the original assignment. Now what is needed is a formula to focus only on reassignment. You did help with not applicable for row 2 and 4, but if there is a instance like in row 3 that will need to be calculated. Hope this clarifies and again thank you for your time. This will be the last request.
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
In that case use
Excel Formula:
=IF(OR(B2="",B2>C2),"not applicable",D2)
 
Upvote 0
Hi Fluff, thank you for your patience. I received the error attached; specifically with row 3.
 

Attachments

  • Error message.PNG
    Error message.PNG
    94.5 KB · Views: 3
Upvote 0
Where are you putting that formula?
 
Upvote 0
Where are you putting that formula?

Hi Fluff, to help, see below. I also noticed two things.

1. Column E row 3 is incorrect in the calculation. Perhaps it is because there is no =NETWORKDAYS formula imbedded into =IF(OR(B3="",B3>C3),"not applicable",D3). That would need to be required for accurate days calculation for the reassigned.

2. I am thinking that =IF(OR(B3="",B3>C3),"not applicable",D3) would need to focus only on column B and C and not have D as a row to calculate as Column E row 3 is incorrect.

3. Column F is an example of what I am needing to solve this issue.

Copy of Example 2.xlsx
ABCDEFGHI
1Date when Originally assignedDate when assignment was reassignedDate when assignment was completedNumber of Days for Originally assigned (Column A) to Date when assignment was completed (Column C)Formula: =IF(OR(B2="",B2>C2),"not applicable",D2)Date when assignment was reassigned (Column B) to Date when assignment was completed (Column C)
23/10/20213/12/20213not applicableNot applicable
33/10/20213/11/20213/18/2021116<-Networkdays formula
43/10/20213/15/20213/10/20211not applicableNot applicable
Sheet1 (4)
Cell Formulas
RangeFormula
D2:D4D2=NETWORKDAYS(IF(B2>C2,A2,MAX(A2,B2)),IF(AND(B2<>"",B2<C2),B2,C2))
E2:E4E2=IF(OR(B2="",B2>C2),"not applicable",D2)
F3F3=NETWORKDAYS(B3,C3)


Again, I truly appreciate your patience. Please let me know where I can write a great review on your behalf.
 
Upvote 0
In that case just replace the D2 with the formula that I originally supplied.
 
Upvote 0
In that case just replace the D2 with the formula that I originally supplied.
Okay cool. I hope that I have not exceed the amount of time you are allowed to allocate to one individual. Please let me know if that is the case.

In regards to you last statement, if I go back to the original formula of (=IF(OR(B2="",B2>C2),"not applicable","") without D, then how can the formula count the days from Column B and C? Is there a way to place a networkdays formula in =IF(OR(B2="",B2>C2),"not applicable",""). I tried =NETWORKDAYS(IF(OR(B2="",B2>C2),"not applicable","") but the formula is missing an opening or closing parenthesis which I cannot figure out. This pertains to column F

Lastly, I attempted to work with the original formula of =NETWORKDAYS(IF(B2>C2,A2,MAX(A2,B2)),IF(AND(B2<>"",B2<C2),B2,C2)) that you provided at the very first response. I noticed in Column D the numbers of days are calculated incorrectly when matching it with column E that only has the formula =Networkdays. Please see image below.

Copy of Example 2.xlsx
ABCDEF
1Date when Originally assignedDate when assignment was reassignedDate when assignment was completedFormula that was provided: =NETWORKDAYS(IF(B2>C2,A2,MAX(A2,B2)),IF(AND(B2<>"",B2<C2),B2,C2)) NETWORKDAYS formula only for column A and BDate when assignment was reassigned (Column B) to Date when assignment was completed (Column C)
23/10/20213/12/202133not applicable
33/10/20213/11/20213/18/202112 
43/10/20213/15/20213/10/202114not applicable
Sheet1 (4)
Cell Formulas
RangeFormula
D2:D4D2=NETWORKDAYS(IF(B2>C2,A2,MAX(A2,B2)),IF(AND(B2<>"",B2<C2),B2,C2))
E2E2=NETWORKDAYS(A2,C2)
F2:F4F2=IF(OR(B2="",B2>C2),"not applicable","")
E3:E4E3=NETWORKDAYS(A3,B3)
 
Upvote 0
I meant like
Excel Formula:
=IF(OR(B2="",B2>C2),"not applicable",NETWORKDAYS(IF(B2>C2,A2,MAX(A2,B2)),C2))
 
Upvote 0
Fantastic!! Awesome. The formula works perfectly regarding column F (y). Hopefully this is the last reply :).

Any luck regarding column D as the count is incorrect. D3 and 4 should be 2 and 4 not 1 and 1.

Copy of Example 2.xlsx
ABCDE
1Date when Originally assignedDate when assignment was reassignedDate when assignment was completedFormula that was provided: =NETWORKDAYS(IF(B2>C2,A2,MAX(A2,B2)),IF(AND(B2<>"",B2<C2),B2,C2)) NETWORKDAYS formula only for column A and B
23/10/20213/12/202133
33/10/20213/11/20213/18/202112
43/10/20213/15/20213/10/202114
Sheet1 (4)
Cell Formulas
RangeFormula
D2:D4D2=NETWORKDAYS(IF(B2>C2,A2,MAX(A2,B2)),IF(AND(B2<>"",B2<C2),B2,C2))
E2E2=NETWORKDAYS(A2,C2)
E3:E4E3=NETWORKDAYS(A3,B3)
 
Upvote 0
Why should D4 be not & not 1, or have you moved the goalposts again?
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

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