Calculate future dates

jgalas

Board Regular
Joined
Jul 4, 2011
Messages
99
Office Version
  1. 2013
Platform
  1. Windows
Hi! I have a task that takes 50 hours. it can start on any business day and runs 2 hours on Tuesdays and 2 hours on Wednesdays. I want to know the end date of the task.
Ex: if the start date is 03/22/2023, the end date will be 06/20/2023 excluding a holiday on Tuesday (holidays and vacation days can be in a column)
can someone give me a tip please
 
What is your start date?
And what if any holidays do you have?
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Thanks for that.
With those dates I get 7th Jul.
Columns F & G show the list of dates & the cumulative hours.
Fluff.xlsm
ABCDEFGH
1DatesHoursDay
222/03/202307/07/202301/04/202322/03/20231Wed
307/07/202302/04/202324/03/20232Fri
403/04/202328/03/20234Tue
504/04/202329/03/20235Wed
605/04/202331/03/20236Fri
706/04/202318/04/20238Tue
807/04/202319/04/20239Wed
908/04/202321/04/202310Fri
1009/04/202326/04/202311Wed
1110/04/202328/04/202312Fri
1211/04/202302/05/202314Tue
1312/04/202303/05/202315Wed
1413/04/202305/05/202316Fri
1514/04/202309/05/202318Tue
1615/04/202310/05/202319Wed
1716/04/202312/05/202320Fri
1825/04/202316/05/202322Tue
1901/05/202317/05/202323Wed
2008/06/202319/05/202324Fri
2110/06/202323/05/202326Tue
2213/06/202324/05/202327Wed
2326/05/202328Fri
2430/05/202330Tue
2531/05/202331Wed
2602/06/202332Fri
2706/06/202334Tue
2807/06/202335Wed
2909/06/202336Fri
3014/06/202337Wed
3116/06/202338Fri
3220/06/202340Tue
3321/06/202341Wed
3423/06/202342Fri
3527/06/202344Tue
3628/06/202345Wed
3730/06/202346Fri
3804/07/202348Tue
3905/07/202349Wed
4007/07/202350Fri
4111/07/202352Tue
Master
Cell Formulas
RangeFormula
F2:G101F2=LET(d,WORKDAY.INTL(A2-1,SEQUENCE(100),"1001011",D2:D50),xx,XLOOKUP(50,SCAN(0,WEEKDAY(d,2),LAMBDA(a,b,IF(b=2,a+2,a+1))),d,,1),HSTACK(d,SCAN(0,WEEKDAY(d,2),LAMBDA(a,b,IF(b=2,a+2,a+1)))))
H2:H101H2=TEXT(INDEX(F2#,,1),"ddd")
B2B2=LET(d,WORKDAY.INTL(A2-1,SEQUENCE(100),"1001011",D2:D50),XLOOKUP(50,SCAN(0,WEEKDAY(d,2),LAMBDA(a,b,IF(b=2,a+2,a+1))),d,,1))
B3B3=INDEX(WORKDAY.INTL(A2-1,ROW(A1:A100),"1001011",D2:D50),AGGREGATE(15,6,ROW(A1:A100)/(MMULT(--(ROW(A1:A100)>=TRANSPOSE(ROW(A1:A100))),IF(WEEKDAY(WORKDAY.INTL(A2-1,ROW(A1:A100),"1001011",D2:D50),2)=2,2,1))>=50),1))
Dynamic array formulas.


Excel Formula:
=ÍNDICE(DIATRABALHO.INTL(A2-1;LIN(A1:A100);"1001011";D2:D50);AGREGAR(15;6;LIN(A1:A100)/(MATRIZ.MULT(--(LIN(A1:A100)>=TRANSPOR(LIN(A1:A100)));SE(DIA.SEMANA(DIATRABALHO.INTL(A2-1;LIN(A1:A100);"1001011";D2:D50);2)=2;2;1))>=50);1))
 
Upvote 0
Solution
Thanks for that.
With those dates I get 7th Jul.
Columns F & G show the list of dates & the cumulative hours.
Fluff.xlsm
ABCDEFGH
1DatesHoursDay
222/03/202307/07/202301/04/202322/03/20231Wed
307/07/202302/04/202324/03/20232Fri
403/04/202328/03/20234Tue
504/04/202329/03/20235Wed
605/04/202331/03/20236Fri
706/04/202318/04/20238Tue
807/04/202319/04/20239Wed
908/04/202321/04/202310Fri
1009/04/202326/04/202311Wed
1110/04/202328/04/202312Fri
1211/04/202302/05/202314Tue
1312/04/202303/05/202315Wed
1413/04/202305/05/202316Fri
1514/04/202309/05/202318Tue
1615/04/202310/05/202319Wed
1716/04/202312/05/202320Fri
1825/04/202316/05/202322Tue
1901/05/202317/05/202323Wed
2008/06/202319/05/202324Fri
2110/06/202323/05/202326Tue
2213/06/202324/05/202327Wed
2326/05/202328Fri
2430/05/202330Tue
2531/05/202331Wed
2602/06/202332Fri
2706/06/202334Tue
2807/06/202335Wed
2909/06/202336Fri
3014/06/202337Wed
3116/06/202338Fri
3220/06/202340Tue
3321/06/202341Wed
3423/06/202342Fri
3527/06/202344Tue
3628/06/202345Wed
3730/06/202346Fri
3804/07/202348Tue
3905/07/202349Wed
4007/07/202350Fri
4111/07/202352Tue
Master
Cell Formulas
RangeFormula
F2:G101F2=LET(d,WORKDAY.INTL(A2-1,SEQUENCE(100),"1001011",D2:D50),xx,XLOOKUP(50,SCAN(0,WEEKDAY(d,2),LAMBDA(a,b,IF(b=2,a+2,a+1))),d,,1),HSTACK(d,SCAN(0,WEEKDAY(d,2),LAMBDA(a,b,IF(b=2,a+2,a+1)))))
H2:H101H2=TEXT(INDEX(F2#,,1),"ddd")
B2B2=LET(d,WORKDAY.INTL(A2-1,SEQUENCE(100),"1001011",D2:D50),XLOOKUP(50,SCAN(0,WEEKDAY(d,2),LAMBDA(a,b,IF(b=2,a+2,a+1))),d,,1))
B3B3=INDEX(WORKDAY.INTL(A2-1,ROW(A1:A100),"1001011",D2:D50),AGGREGATE(15,6,ROW(A1:A100)/(MMULT(--(ROW(A1:A100)>=TRANSPOSE(ROW(A1:A100))),IF(WEEKDAY(WORKDAY.INTL(A2-1,ROW(A1:A100),"1001011",D2:D50),2)=2,2,1))>=50),1))
Dynamic array formulas.


Excel Formula:
=ÍNDICE(DIATRABALHO.INTL(A2-1;LIN(A1:A100);"1001011";D2:D50);AGREGAR(15;6;LIN(A1:A100)/(MATRIZ.MULT(--(LIN(A1:A100)>=TRANSPOR(LIN(A1:A100)));SE(DIA.SEMANA(DIATRABALHO.INTL(A2-1;LIN(A1:A100);"1001011";D2:D50);2)=2;2;1))>=50);1))
My bad! It works for 2 hours Tuesday, 1 hour Wednesday and 1 hour Friday.
If i want to change for 2 hours Monday, 1 hour Wednesday and 1 hour Friday. I just change "1001011" to "0101011" right?
 
Upvote 0
That's right. :)
But you also need to change this part
Excel Formula:
IF(WEEKDAY(WORKDAY.INTL(A2-1,ROW(A1:A100),"1001011",D2:D50),2)=2,2,1)
from =2 to =1
 
Upvote 0
That's right. :)
But you also need to change this part
Excel Formula:
IF(WEEKDAY(WORKDAY.INTL(A2-1,ROW(A1:A100),"1001011",D2:D50),2)=2,2,1)
from =2 to =1
Thanks a lot. It works
If i want to change for 1 hours Tuesday, 2 hour Wednesday and 1 hour Friday. I keep "1001011", right!
for this example, I have to change something else in the formula IF(WEEKDAY(WORKDAY.INTL(A2-1,ROW(A1:A100),"1001011",D2:D50),2)=2,2,1)?

There can be several combinations, i can have 2/1/1 hours or 1/2/1 or 1/1/2 or 2/2 distributed by days of the week
 
Upvote 0
If i want to change for 1 hours Tuesday, 2 hour Wednesday and 1 hour Friday. I keep "1001011", right!
That's right.
For Mon as 2 hours you would need to use =1 instead of =2, for Wed it would be =3 & for Fri =5
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 1

Forum statistics

Threads
1,214,590
Messages
6,120,421
Members
448,961
Latest member
nzskater

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