Workday formula required based on depending dates

exceluser9

Active Member
Joined
Jun 27, 2015
Messages
388
Hi Team :)

I have below data and im using formula =WORKDAY(C2,1) to calculate the workdate based on the received date.

However, I have 3 depending activities for which the workday should calculate only after the depending task is completed. and it will be next workday after the depending task is completed. If the dependent tasks arent completed then the workday column should remain blank.

For each SL # there will be 8 task out of 8 the 3 are dependent task i.e Logo, agreement and Number

Agreement is dependent on Temp completion, Logo is dependent on Number completion and Number is dependent on other 6 tasks. The workday for Number should check for the latest date of 6 activities and calculate the next workday.

This is a sample data and the data is in 2000 rows with similar format. And the formula should work only if it finds 8 tasks for a SL # anything less than 8 it should remain blank.

Thanks in advance

Column AColumn BColumn CColumn DColumn E
SL #FilesEmail receivedWorkday calculationTask completed
18137Document01/07/201902/07/201903/07/2019
18137Report01/07/201902/07/201905/07/2019
18137Protocol01/07/201902/07/201906/07/2019
18137Due01/07/201902/07/201906/07/2019
18137Logo01/07/201912/07/201917/07/2019
18137Agreement01/07/201904/07/201914/07/2019
18137Number01/07/201915/07/201911/07/2019
18137Temp01/07/201902/07/201903/07/2019

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
 
In your latest example, 18137/Number finds Document, Report, Protocol, Due, Agreement and Temp with completed dates. 6 items. 18134/Number finds Document, Report, Protocol, Due, Agreement, and Form with completed dates. 6 items. None of the Workdays show up as 2/1/1900.
 
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
2/1/1900 was displayed when i used your formula. I have input the dates manually now to give you examples.
 
Upvote 0
Try:

Excel 2012
ABCDE
1SL #FilesEmail receivedWorkday calculationTask completed
218137Document7/1/20197/2/20197/3/2019
318137Report7/1/20197/2/20197/5/2019
418137Protocol7/1/20197/2/20197/6/2019
518137Due7/1/20197/2/20197/6/2019
618137Logo7/1/20197/12/20197/17/2019
718137Agreement7/1/20197/4/20197/11/2019
818137Number7/1/20197/12/20197/11/2019
918137Temp7/1/20197/2/20197/3/2019
10167Modify calender7/3/20197/4/20197/9/2019
11167Modify machine7/3/20197/4/20197/9/2019
1218134Logo8/6/2019
1318134Agreement8/6/20198/7/20198/12/2019
1418134Due8/6/20198/7/20198/12/2019
151647Modify Loan8/17/20198/19/2019
1618134Form8/6/20198/7/20198/12/2019
1718134Document7/1/20197/2/20198/14/2019
1818134Report7/1/20197/2/20197/5/2019
1918134Protocol7/1/20197/2/20197/6/2019
2018134Logo7/1/2019
2118134Number7/1/20198/15/2019

<colgroup><col style="width: 25pxpx" https:="" www.mrexcel.com="" forum="" usertag.php?do="list&action=hash&hash=DAE7F5"" target="_blank"></colgroup><colgroup><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet11


Worksheet Formulas
CellFormula
D2
=IFERROR(CHOOSE(MATCH(B2,{"Logo","Agreement","Number"},0),IFERROR(WORKDAY(1/(1/SUMIFS(E:E,A:A,A2,B:B,"Number")),1),""),IF(COUNTIFS(A:A,A2,B:B,"Temp")=0,NA(),IFERROR(WORKDAY(1/(1/SUMIFS(E:E,A:A,A2,B:B,"Temp")),1),"")),IFERROR(WORKDAY(MAX(SUMIFS(E:E,A:A,A2,B:B,{"Document","Report","Protocol","Due","Agreement","Temp","Form"})),1)/(SUM(COUNTIFS(A:A,A2,B:B,{"Document","Report","Protocol","Due","Agreement","Temp","Form"},E:E,">0"))>=6),"")),WORKDAY(C2,1))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0
Hi Eric,

Also I require one more formula for a different data where there is one more addition i.e Logo S. Where the workday calculation for it should happen once the completed date for
"Number" is found until then "Logo S" should be blank and once "Logo S" has a completed date "Logo" should get a workday calculation until then it should remain blank. Below is the example of the data and expected result.

Its a similar logic, only addition here is Logo S. Logo is dependent on Logo S date completion and Logo S is dependent on "Number" completion.

Below is the example.

SL#FilesEmail reccivedWorkday calculationCompleted date
18137Document07/01/201908/01/201909/01/2019
18137Report07/01/201908/01/201909/01/2019
18137Protocol07/01/201908/01/201909/01/2019
18137Due07/01/201908/01/201909/01/2019
18137Logo07/01/201915/03/2019
18137Agreement07/01/201910/03/201911/03/2019
18137Number07/01/201912/03/201913/03/2019
18137Temp07/01/201908/01/201909/01/2019
18137Logo S07/01/201914/03/201914/03/2019
167Modify calender07/03/201908/03/2019
167Modify machine07/03/201908/03/2019
1647Modify Loan08/06/201910/06/2019
18134Form08/06/201910/06/201911/06/2019
18134Document08/06/201910/06/201911/06/2019
18134Report08/06/201910/06/201911/06/2019
18134Protocol08/06/201910/06/201911/06/2019
18134Logo08/06/201914/06/2019
18134Number08/06/201912/06/201912/06/2019
18134Agreement08/06/201910/06/201911/06/2019
18134Due08/06/201910/06/201911/06/2019
18134Logo S08/06/201913/06/201913/06/2019

<colgroup><col><col span="2"><col><col></colgroup><tbody>
</tbody>


 
Upvote 0
Try in D2:

=IFERROR(CHOOSE(MATCH(B2,{"Logo","Logo S","Agreement","Number"},0),IFERROR(WORKDAY(1/(1/SUMIFS(E:E,A:A,A2,B:B,"Logo S")),1),""),IFERROR(WORKDAY(1/(1/SUMIFS(E:E,A:A,A2,B:B,"Number")),1),""),IF(COUNTIFS(A:A,A2,B:B,"Temp")=0,NA(),IFERROR(WORKDAY(1/(1/SUMIFS(E:E,A:A,A2,B:B,"Temp")),1),"")),IFERROR(WORKDAY(MAX(SUMIFS(E:E,A:A,A2,B:B,{"Document","Report","Protocol","Due","Agreement","Temp","Form"})),1)/(SUM(COUNTIFS(A:A,A2,B:B,{"Document","Report","Protocol","Due","Agreement","Temp","Form"},E:E,">0"))>=6),"")),WORKDAY(C2,1))
 
Upvote 0
Thanks Eric, it works, appreciate your help.

Quick question can the holiday list be added? so that the workday calculates after the holiday date in case i need in future?
 
Upvote 0
Sure, just add the holiday range to all the WORKDAY functions, like $G$2:$G$4:

=IFERROR(CHOOSE(MATCH(B2,{"Logo","Logo S","Agreement","Number"},0),IFERROR(WORKDAY(1/(1/SUMIFS(E:E,A:A,A2,B:B,"Logo S")),1,$G$2:$G$4),""),IFERROR(WORKDAY(1/(1/SUMIFS(E:E,A:A,A2,B:B,"Number")),1,$G$2:$G$4),""),IF(COUNTIFS(A:A,A2,B:B,"Temp")=0,NA(),IFERROR(WORKDAY(1/(1/SUMIFS(E:E,A:A,A2,B:B,"Temp")),1,$G$2:$G$4),"")),IFERROR(WORKDAY(MAX(SUMIFS(E:E,A:A,A2,B:B,{"Document","Report","Protocol","Due","Agreement","Temp","Form"})),1,$G$2:$G$4)/(SUM(COUNTIFS(A:A,A2,B:B,{"Document","Report","Protocol","Due","Agreement","Temp","Form"},E:E,">0"))>=6),"")),WORKDAY(C2,1,$G$2:$G$4))
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

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