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>
 
I'm still seeing some issues with duplicates. In your latest example, I see 18134 Due twice, and 18134 Agreement twice, and 18134 Number twice. For now, I'm going to assume that those are typos. If there are no duplicates, we can go back to the simpler formula. Try this one:

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/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),""),WORKDAY(1/(1/SUMIFS(E:E,A:A,A2,B:B,"Temp")),1),IFERROR(WORKDAY(MAX(1/(1/SUMIFS(E:E,A:A,A2,B:B,{"Document","Report","Protocol","Due","Agreement","Temp"}))),1),"")),WORKDAY(C2,1))

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

<tbody>
</tbody>



On this one, I changed it so that if Agreement can't find Temp, it shows next workday. If Logo can't find Number, it shows as blank. And if Number can't find one of its 6 subordinate tasks, it shows blank. Everything else shows next workday.

Let me know how this works.
 
Last edited:
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi Eric,

I tried the formula but for SL# 18137 on Agreement its gives the date even before the task for Temp is completed. It should be blank, could you help. Thanks in advance

For SL # 18134 it works fine.

SL#FilesEmail reccivedWorkday calculation
18137Document07/01/201908/01/2019
18137Report07/01/201908/01/2019
18137Protocol07/01/201908/01/2019
18137Due07/01/201908/01/2019
18137Logo07/01/2019
18137Agreement07/01/201908/01/2019
18137Number07/01/2019
18137Temp07/01/201908/01/2019
167Modify calender07/03/201908/03/2019
167Modify machine07/03/201908/03/2019
1647Modify Loan08/06/201910/06/2019
18134Form08/06/201910/06/2019
18134Document07/01/201908/01/2019
18134Report07/01/201908/01/2019
18134Protocol07/01/201908/01/2019
18134Logo07/01/2019
18134Number07/01/2019
18134Agreement08/06/201910/06/2019
18134Due08/06/201910/06/2019

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
Hi Eric,

Also i have noticed that for SL# 18134 the date for Number is no populating once 6 task is completed. Is it because Form is not part of "Document","Report","Protocol","Due","Agreement","Temp"?
 
Upvote 0
You're giving me mixed messages:
exceluser9 said:
But for agreement in SL# 18134 comes as blank in workday calculation. It should display next workday if the depending task is not there.

Hi Eric,

I tried the formula but for SL# 18137 on Agreement its gives the date even before the task for Temp is completed. It should be blank, could you help. Thanks in advance

I'll go back to the original method.

exceluser9 said:
Also i have noticed that for SL# 18134 the date for Number is no populating once 6 task is completed. Is it because Form is not part of "Document","Report","Protocol","Due","Agreement","Temp"?

Yes. Should Temp be the equivalent of Form? Should I populate Number if I get any 6 out of
"Document","Report","Protocol","Due","Agreement","Temp","Form"? Exactly what conditions are necessary to populate Number?
 
Upvote 0
Hi Eric.

Nope, temp is not equivalent to Form. Temp is equivalent only to Agreement. Date for agreement should be populated only if temp has a completed date, if not it should remain blank.

However, if temp is not part of the respective SL# only then Agreement should calculate next workday.

Yes please populate Number if you get any 6 out of "Document","Report","Protocol","Due","Agreement","Temp","Form".
 
Upvote 0
Try this in D2:

Code:
=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"}))>=6),"")),WORKDAY(C2,1))
 
Upvote 0
HI Eric,

Apologies, I think there is a miscommunication. Workday calculation for "Number" should be populated only if 6 tasks are completed out of 7. Also workday calculation for "Number" is populated as 02/01/1900 instead of blank. Sry again.

SL#FilesEmail reccivedWorkday calculation
18137Document07/01/201908/01/2019
18137Report07/01/201908/01/2019
18137Protocol07/01/201908/01/2019
18137Due07/01/201908/01/2019
18137Logo07/01/2019
18137Agreement07/01/2019
18137Number07/01/201902/01/1900
18137Temp07/01/201908/01/2019
167Modify calender07/03/201908/03/2019
167Modify machine07/03/201908/03/2019
1647Modify Loan08/06/201910/06/2019
18134Form08/06/201910/06/2019
18134Document08/06/201910/06/2019
18134Report08/06/201910/06/2019
18134Protocol08/06/201910/06/2019
18134Logo08/06/2019
18134Number08/06/201902/01/1900
18134Agreement08/06/201910/06/2019
18134Due08/06/201910/06/2019

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
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. Since its a similar logic im including in same thread. Thank you for your support. Appreciate it:)

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><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
When you show your sample data, please show all columns. I am unable to replicate your results from post 17 without the "Completed Date" column. I assume you want the additional changes from post 18 incorporated into the same formula?
 
Upvote 0
HI Eric,

Please ignore post 18 for now, its a formula for new requirement and i will update it with details once this task is completed.

Below is the example for post 17 with completed date column.
Workday calculation for "Number" should be populated only if 6 tasks are completed out of 7. Also workday calculation for "Number" is populated as 02/01/1900 instead of blank with formula as per post 16




SL#FilesEmail reccivedWorkday calculationCompleted date
18137Document07/01/201908/01/201909/01/2019
18137Report07/01/201908/01/201910/01/2019
18137Protocol07/01/201908/01/201911/01/2019
18137Due07/01/201908/01/201913/01/2019
18137Logo07/01/201916/01/2019
18137Agreement07/01/201910/01/201910/01/2019
18137Number07/01/201914/01/201915/01/2019
18137Temp07/01/201908/01/201909/01/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/201912/06/2019
18134Report08/06/201910/06/201913/06/2019
18134Protocol08/06/201910/06/201918/06/2019
18134Logo08/06/201924/06/2019
18134Number08/06/201921/06/201922/06/2019
18134Agreement08/06/201910/06/201920/06/2019
18134Due08/06/201910/06/201918/06/2019

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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