Formula for Calculating Production Finish Time

L

Legacy 143009

Guest
Hi,
ProductOrder (pcs.)Production Time (min./pcs.) Start DateStart Time Finish Date Finish Time
FA0074790024023.11.202319:50


I need 2 formulas to calculate the finish date and time for the given work order.
The rules are:
1. Factory is working in two shifts 08:00-16:00 and 16:00-24:00
2. Factory is not working on Sundays

You may consider the table starting from A2 cell.

Thanks for your support!
 
Last edited by a moderator:

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Here is a working example I think:

Production time.xlsx
ABCDEFGHI
1ProductOrder (pcs.)Production time (min./pcs.)Start DateStart TimeFinish DateFinish TimeExample calendar
2FA0074790024023/11/202319:5012/08/202419:5023/11/2023 ju
3TestValue01124023/11/202320:0024/11/202300:0024/11/2023 vi
4TestValue02224023/11/202320:0024/11/202312:0025/11/2023 sá
5TestValue03324023/11/202320:0024/11/202316:0026/11/2023 do
6TestValue04424023/11/202320:0024/11/202320:0027/11/2023 lu
7TestValue05524023/11/202320:0025/11/202300:0028/11/2023 ma
8TestValue06624023/11/202320:0025/11/202312:0029/11/2023 mi
9TestValue07724023/11/202320:0025/11/202316:0030/11/2023 ju
10TestValue08824023/11/202320:0025/11/202320:0001/12/2023 vi
11TestValue09924023/11/202320:0026/11/202300:0002/12/2023 sá
12TestValue101024023/11/202320:0027/11/202312:0003/12/2023 do
13TestValue111124023/11/202320:0027/11/202316:0004/12/2023 lu
14TestValue121224023/11/202320:0027/11/202320:0005/12/2023 ma
15TestValue131324023/11/202320:0028/11/202300:0006/12/2023 mi
16TestValue141424023/11/202320:0028/11/202312:0007/12/2023 ju
17TestValue151524023/11/202320:0028/11/202316:0008/12/2023 vi
18TestValue161624023/11/202320:0028/11/202320:0009/12/2023 sá
19TestValue171724023/11/202320:0029/11/202300:0010/12/2023 do
20TestValue181824023/11/202320:0029/11/202312:0011/12/2023 lu
21TestValue191924023/11/202320:0029/11/202316:0012/12/2023 ma
22TestValue202024023/11/202320:0029/11/202320:0013/12/2023 mi
23TestValue212124023/11/202320:0030/11/202300:0014/12/2023 ju
24TestValue222224023/11/202320:0030/11/202312:0015/12/2023 vi
25TestValue232324023/11/202320:0030/11/202316:0016/12/2023 sá
26TestValue242424023/11/202320:0030/11/202320:0017/12/2023 do
27TestValue252524023/11/202320:0001/12/202300:0018/12/2023 lu
28TestValue262624023/11/202320:0001/12/202312:0019/12/2023 ma
29TestValue272724023/11/202320:0001/12/202316:0020/12/2023 mi
Hoja2
Cell Formulas
RangeFormula
F2:F29F2=IF(ROUND((((B2*C2/60)+(E2-TIMEVALUE("8:00"))*24)-INT(((B2*C2/60)+(E2-TIMEVALUE("8:00"))*24)/16)*16),5)/24=0,WORKDAY.INTL(D2,INT(((B2*C2/60)+(E2-TIMEVALUE("8:00"))*24)/16)-1,11)+1,WORKDAY.INTL(D2,INT(((B2*C2/60)+(E2-TIMEVALUE("8:00"))*24)/16),11))
G2:G29G2=IF(ROUND((((B2*C2/60)+(E2-TIMEVALUE("8:00"))*24)-INT(((B2*C2/60)+(E2-TIMEVALUE("8:00"))*24)/16)*16),5)/24=0,0,ROUND((((B2*C2/60)+(E2-TIMEVALUE("8:00"))*24)-INT(((B2*C2/60)+(E2-TIMEVALUE("8:00"))*24)/16)*16),5)/24+TIMEVALUE("8:00"))
I2I2=D2
I3:I29I3=I2+1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I2:I30Expression=DIASEM(I2)=1textNO
 
Upvote 0
Solution
My pleasure. Thanks for the feedback.

As the formulae are a little complex here is the same calculation but in steps (and how it came to be) for more clarity:

Production time.xlsx
ABCDEFGHIJKLMNOP
1ProductOrder (pcs.)Production time (min./pcs.)Start DateStart TimeProduction time (hours)Production time + start hourProd time in Days - hours (not used - just to see the time)Prod time in daysProd time remaining hoursFinish DateFinish TimeExample calendar
2FA0074790124023/11/202319:5036043615,83333312 15:5022515:50:0012/08/202423:5023/11/2023 ju
3TestValue01124023/11/202320:004161 00:0010:00:0024/11/202300:0024/11/2023 vi
4TestValue02224023/11/202320:008201 04:0014:00:0024/11/202312:0025/11/2023 sá
5TestValue03324023/11/202320:0012241 08:0018:00:0024/11/202316:0026/11/2023 do
6TestValue04424023/11/202320:0016281 12:00112:00:0024/11/202320:0027/11/2023 lu
7TestValue05524023/11/202320:0020322 00:0020:00:0025/11/202300:0028/11/2023 ma
8TestValue06624023/11/202320:0024362 04:0024:00:0025/11/202312:0029/11/2023 mi
9TestValue07724023/11/202320:0028402 08:0028:00:0025/11/202316:0030/11/2023 ju
10TestValue08824023/11/202320:0032442 12:00212:00:0025/11/202320:0001/12/2023 vi
11TestValue09924023/11/202320:0036483 00:0030:00:0026/11/202300:0002/12/2023 sá
12TestValue101024023/11/202320:0040523 04:0034:00:0027/11/202312:0003/12/2023 do
13TestValue111124023/11/202320:0044563 08:0038:00:0027/11/202316:0004/12/2023 lu
14TestValue121224023/11/202320:0048603 12:00312:00:0027/11/202320:0005/12/2023 ma
15TestValue131324023/11/202320:0052644 00:0040:00:0028/11/202300:0006/12/2023 mi
16TestValue141424023/11/202320:0056684 04:0044:00:0028/11/202312:0007/12/2023 ju
17TestValue151524023/11/202320:0060724 08:0048:00:0028/11/202316:0008/12/2023 vi
18TestValue161624023/11/202320:0064764 12:00412:00:0028/11/202320:0009/12/2023 sá
19TestValue171724023/11/202320:0068805 00:0050:00:0029/11/202300:0010/12/2023 do
20TestValue181824023/11/202320:0072845 04:0054:00:0029/11/202312:0011/12/2023 lu
21TestValue191924023/11/202320:0076885 08:0058:00:0029/11/202316:0012/12/2023 ma
22TestValue202024023/11/202320:0080925 12:00512:00:0029/11/202320:0013/12/2023 mi
23TestValue212124023/11/202320:0084966 00:0060:00:0030/11/202300:0014/12/2023 ju
24TestValue222224023/11/202320:00881006 04:0064:00:0030/11/202312:0015/12/2023 vi
25TestValue232324023/11/202320:00921046 08:0068:00:0030/11/202316:0016/12/2023 sá
26TestValue242424023/11/202320:00961086 12:00612:00:0030/11/202320:0017/12/2023 do
27TestValue252524023/11/202320:001001127 00:0070:00:0001/12/202300:0018/12/2023 lu
28TestValue262624023/11/202320:001041167 04:0074:00:0001/12/202312:0019/12/2023 ma
29TestValue272724023/11/202320:001081207 08:0078:00:0001/12/202316:0020/12/2023 mi
Hoja1
Cell Formulas
RangeFormula
G2:G29G2=B2*C2/60
H2:H29H2=G2+(E2-TIMEVALUE("8:00"))*24
I2:I29I2=INT(H2/16)+(H2-INT(H2/16)*16)/24
J2:J29J2=INT(H2/16)
K2:K29K2=ROUND((H2-INT(H2/16)*16),5)/24
L2:L29L2=IF(K2=0,WORKDAY.INTL(D2,J2-1,11)+1,WORKDAY.INTL(D2,J2,11))
M2:M29M2=IF(K2=0,0,K2+TIMEVALUE("8:00"))
P2P2=D2
P3:P29P3=P2+1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
P2:P30Expression=DIASEM(P2)=1textNO
 
Upvote 0
Thank you very much. It was quite clear for me but it will be useful for beginners. Thanks for your efforts again 🙏
 
Upvote 0

Forum statistics

Threads
1,215,194
Messages
6,123,569
Members
449,108
Latest member
rache47

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