Hi @Johnny Harrang ,
Welcome to Q&A forum!
According to your description, the following formula is just a reference, you can change it according to your needs. In my test case, the working hours are 8:00 am-18:00 pm from Monday to Friday.
=IF(AND(WEEKDAY(E2)>=6,WEEKDAY(F2>=6)),"100%",IF(DAYS(F2,E2)=0,IF(AND(HOUR(E2>=8),HOUR(F2)<=18),"100%",ROUND((MOD(F2,1)-"18:00")/(F2-E2)*100%,1)),IF(AND(HOUR(E2)>=18,HOUR(F2)<=8),"100%",ROUND(("6:00"+MOD(F2,1))/(F2-E2)*100%,1))))
----------
Update:
Please check the following formulars:
- E2:
IF(I2<=5,IF(AND(("15:30"-C2)>=0,("15:30"-D2)>=0),D2-C2,IF(AND(("15:30"-C2)>=0,("15:30"-D2)<0),"15:30"-C2,"")),"")
- F2:
IF(I2<=5,IF(AND(("15:30"-C2)>=0,("15:30"-D2)>=0),"",IF(AND(("15:30"-C2)>=0,("21:00"-D2)<0),"21:00"-"15:30",IF(AND(("15:30"-C2)>=0,("21:00"-D2)>=0),D2-"15:30",IF(AND(("15:30"-C2)<0,("21:00"-C2)>=0,("21:00"-D2)>=0),D2-C2,IF(AND(("15:30"-C2)<0,("21:00"-C2)>=0,("21:00"-D2)<0),"21:00"-C2,""))))),"")
- G2:
IF(I2>5,D2-C2,IF(AND(("21:00"-C2)<0,("21:00"-D2)<0),D2-C2,IF(AND(("21:00"-C2)>=0,("21:00"-D2)<0),D2-"21:00","")))
Hope the information is helpful to you.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.