I'm from Turkiye and my level is intermediate. I reply mails in 8 hours at work. My question is about time calculation.
Conditions
1. Our work starts at 09:00 and finishes at 18:00.
2. Mails must be replied in 8 hours.
3. Mails must be replied only between 09:00 and 18:00.
4. We don't work between 18:00 and the next day 09:00.
So these period doesn't count in the calculation. This is the most critical part also.
My Excel File. I explained all conditions in the workbook.
So we can break down your all condition to basically two categories. One, where (Mail Received Time + 8 Hours) is less than or equal to 18:00 Hrs, other is where it falls beyond 18:00 Hrs.
Use the formula in the Reply Deadline with formula column and drag it down to get the desired answer
=IF((A7+"8:00"<=TIME(18,0,0)),MAX(A7,"9:00")+"8:00",MIN(A7,"18:00")+"23:00")
Explanation
IF condition checks if the mail received time + 8:00 hrs is less than or equal to 18:00 hrs and returns a TRUE or FALSE value
Output: =IF((FALSE),MAX(A7,"9:00")+"8:00",MIN(A7,"18:00")+"23:00")
If TRUE the time is added by 8:00 hrs to give the deadline. MAX has been used to eliminate any mail received time that is before 9:00 Hrs as in 08:28 Hrs
If FALSE the time is added by 23:00 hrs. This is because 8:00 hrs is the normal deadline and remaining 15:00 hrs is accounted for time we don't work i;e from 18:00 Hrs to next day 9:00 Hrs. MIN is used to consider when the mail received time is less than 18:00 hrs.
Let me know if I can make it more clear.
EDIT
Here is my sample file with solution formulas embedded.
Please try the below formula,
=IF(OR(A2<TIME(9,0,0),A2>TIME(18,0,0)),TIME(17,0,0),IF(A2+TIME(8,0,0)<=TIME(18,0,0),A2+TIME(8,0,0),A2+TIME(23,0,0)))
This formula consists of 2 IF conditions.
The first IF checks if the time falls in non-working hours (between 18:00 and 9:00). If so, the time is calculated as 17:00. If the time falls in the working range, the next IF condition adds 8:00 hours or 23:00 accordingly. (23:00 hours for overlapping period). Hope this helps.
excelevator solved the problem on reddit also.
https://www.reddit.com/r/excel/comments/65l25n/reply_time_calculation_issue/
Related
Let's say i logged in today 9:00 AM and end up 5:00 PM i have to produce 4000 items i know it will exceed the time because my software will stop working at 5 PM so tomorrow when i start working again what would be date and time of completion work
What i did
bring working hour =SUM(B2-A2)
total complete work=ROUND(D2/C2, 2)
If i understood correctly you can use the simple difference of times and correct formatting for the time cells to get the remaining hours
The Formula in cell C5 is simple =C1-C3
The formatting applied to the cells is as below
10.95 hours is equal to 10 hours and 57 (95% of 60) minutes
You can write 10:57:00 instead of 10.95
To convert the time to again a number you can divide the time by 0.041666667 and set the format to general
Need difference between Created & Closed In Hours along with below
The TAT hour to be calculated between 9:00 am to 09:00 pm which is working hours, if created time us 09 pm then it should be considered from next day 9 am.
Sunday is Holiday
I have tried:- =Created-Closed Date, but don't know how to exclude Sunday and calculate only shift hours.
Yes! Finally Self Got Answer For it.
Here is that
=(NETWORKDAYS(A2,B2)-1)*("21:00:00"-"09:00:00")
+IF(NETWORKDAYS(B2,B2),MEDIAN(MOD(B2,1),"21:00:00","09:00:00"),"21:00:00")
-MEDIAN(NETWORKDAYS(A2,A2)*MOD(A2,1),"21:00:00","09:00:00")
I am trying to calculate downtime for devices. I would like to count only those time which is laying in a particular time slot. I am calling this time slot Min & Max time. All the timestamp is with dates but when the date is changed time should calculate according to that. for one device I am able to do that but same formulas are not working for next device.
Logic: Timestamp is 22:00 and device the last timestamp was 6:00 hours before.
And Min 6:00 AM to 18:00 PM
So the downtime would be 2 hours. coz last time device communicated was 16:00 hours & downtime consider at 18:00 hours.
file
Break it down into steps. I will use Time(6,0,0) and Time(18,0,0) as your start/end times, but you may want to make them cell references. I will also use Min_Date and Max_Date as the 2 timestamps you are comparing
Step 0: Check if the day is the same - if so, just calculate as normal. Otherwise, carry on with the next Steps:
=MEDIAN(TIME(6,0,0), Mod(Max_Date,1), Time(18,0,0)) - MEDIAN(TIME(6,0,0), Mod(Min_Date,1), Time(18,0,0))
Step 1: How many Full Days downtime? (i.e. 2018-01-01 12:00 to 2018-01-03 12:00 has 1 full day, 2018-01-02) Multiply this by the hours per day:
=Max(Int(Max_Date)-Int(Min_Date)-1, 0) * (Time(18,0,0)-Time(6,0,0))
Step 2: How much of the First day was downtime?
=TIME(18,0,0)-MEDIAN(TIME(6,0,0), Mod(Min_Date,1), Time(18,0,0))
Step 3: How much of the Last day was downtime?
=MEDIAN(TIME(6,0,0), Mod(Max_Date,1), Time(18,0,0))-TIME(6,0,0)
Step 4: Add together Steps 1, 2, and 3
Just tie those together into 1 formula, and voilá.
I'm working on a simple timesheet that should calculate overtime1 and overtime2, I just cant figure out a good way to fix it.
Normal workday on 8hrs from 07:00 to 17:00 give no overtime (eg 07:00 to 16:00 or 08:00 to 17:00), but when time exceeds 8 hours I would like to get the exceeding hours in a cell.
My business rules are:
1) Any work greater than 8 hours between the hours of 06:00 to 20:00 get paid as overtime1.
2) Any work less than 8 hours will not generate any overtime2 even if after 20:00
3) Any work performed earlier than 06:00 or later than 20:00 get paid at the overtime2 rate.
Example 1: Working from 07:00 to 18:00 would get a value of 3 hours of overtime1
Example 2: Working from 14:00 to 22:00 would generate 0 hours of overtime2.
Example 3: Working 05:00 to 21:00 would give overtime1 6 hours and overtime2 2 hours (1 hour before 06:00, 1 hour after 20:00).
This is a pretty easy problem to solve if your data is laid out smartly. With column A as clock in time and column B as clock out time, use this formula as a helper to determine if you should use the clock in time or your base of 06:00:
=IF(A1-FLOOR(A1,2)<6/24,6/24,A1-FLOOR(A1,2))
Then use this formula to determine if you should use clock out time or 20:00:
=IF(B1-FLOOR(B1,2)>20/24,20/24,B1-FLOOR(B1,2))
Then you subtract the two to get fractions of a day, multiply by 24 to convert to hours, then subtract 8 to get hours of overtime1. Combined in a super formula it looks like this in C1:
OT1: =IF(OR(ISBLANK(A1),ISBLANK(B1)),"",(IF(B1-FLOOR(B1,2)>20/24,20/24,B1-FLOOR(B1,2))-IF(A1-FLOOR(A1,2)<6/24,6/24,A1-FLOOR(A1,2)))*24-8)
Remember, Excel formats dates where 1 = 24 hours. Also, I added in an OR(ISBLANK(A1),ISBLANK(B1)) statement to make sure you get a null string if one of the values is blank.
Starting on the overtime2, you need to split it into two parts: before 06:00 and after 20:00. The first part checks if the clock in time is earlier than 06:00 and if so figures out how many hours. The formula ultimately ends up being:
=IF(IF(A1-FLOOR(A1,2)<6/24,6/24,A1-FLOOR(A1,2))<=6/24,(6/24-(A1-FLOOR(A1,2)))*24,0)
For after 20:00, the same pattern is used. Figure out how many parts of a day were logged after 20:00. The final formula ends up being:
=IF(IF(B1-FLOOR(B1,2)>20/24,20/24,B1-FLOOR(B1,2))>=20/24,((B1-FLOOR(B1,2))-20/24)*24,0)
Finally, to figure out the total number of overtime 2, just add the two formulas together in D1:
OT2: =IF(OR(ISBLANK(A1),ISBLANK(B1)),"",IF(IF(A1-FLOOR(A1,2)<6/24,6/24,A1-FLOOR(A1,2))<=6/24,(6/24-(A1-FLOOR(A1,2)))*24,0)+IF(IF(B1-FLOOR(B1,2)>20/24,20/24,B1-FLOOR(B1,2))>=20/24,((B1-FLOOR(B1,2))-20/24)*24,0))
It's just about getting the logic right and understanding that Excel treats 07:00 as a decimal equal to 7/24, for example.
OT1
=IF(NOT(AND(Sheet1!$A2>=7/24,Sheet1!$B2<=17/24)),MIN(20/24,Sheet1!$B2)-Sheet1!$A2-9/24,0)
OT2
=IF(MIN(20/24,Sheet1!$B2)-Sheet1!$A2-9/24,MAX(B2-20/24,0),0)
Assume I have such data:
29.10.2014 19:00 30.10.2014 7:30
29.10.2014 23:00 29.10.2014 18:00
30.10.2014 9:00 30.10.2014 23:15
31.10.2014 18:49 1.11.2014 7:15
How to get that time which is between 22:00 to 6:00. Like first example row 29.10.2014 19:00 30.10.2014 7:30 whole work time is 12:30 (12,5h) and work time between 22-6 is 8:00 (8h). How to get this 8h. Used some searches and find sumproducts, sumifs, countifs but didn't handle them by myself. :/
This article seems to answer your question:
https://office.microsoft.com/en-us/excel-help/calculate-the-difference-between-two-times-HP003056108.aspx
It's easier to calculate the time between 06:00 and 22:00, so assuming start time/date in A2 and end time/date in B2 use this formula to get decimal hours
=(MOD(B2,1)< MOD(A2,1))*(22-6)+MEDIAN(6,22,MOD(B2,1)*24)-MEDIAN(6,22,MOD(A2,1)*24)
That also assumes that end time will either be the same day or the next, is that right?
To get 22-6 time just calculate total time minus the above, so if the above is in C2 use this in D2
=(B2-A2)*24-C2
I assume that your second example is an error because start time/date is after end time/date