add hours in excel based on 8 hrs - excel

In my excel I have the project status in hours only .
it means
M1 4 hrs
M2 6 hrs
M3 10 hrs
M4 3 hrs
I have to create a excel so that if I give a start date all the simillar dates needs to be calculated based on 8 hrs working time.
for example if my start date 09/01/2010 (this is the date entered by me)(mm/dd/yyyy)
Start Date End Date
M1 09/01/2010 09/01/2010 (4 hrs)
M2 09/01/2010 09/02/2010 (6 hrs so talking 2 hrs from 09/02/2010)
M3 09/02/2010 09/03/2010 (6 hrs from 9/2/2010 and 4 hrs from 9/3/2010)
M4 09/03/2010 09/03/2010 (3 hrs from 9/3/2010)
Please any one can give me a suggestion.
Thanks,
Aswini Mahesh.

You have to know that dates and time in xl are stored in days since jan-1-1900 (or any fixed reference date, it does really matter which one). This allows easy addition/subtraction.
From that you can deduct that 1 day has a value of 1, and therefore 1 hour has a value of 1/24.
To test this, enter any date or time in cell, then clear cell the format.
Once you get this, you can solve any problem.

Example:
A B C
Start Date End Date Total Hours
9/15/2010 1:32 9/16/2010 1:32 24:00
9/15/2010 1:32 9/15/2010 13:32 12:00
9/15/2010 1:32 9/15/2010 7:32 06:00
9/15/2010 1:32 9/15/2010 8:44 07:12
C Cell have formula: =b2-a2+IF(a2>b2,1)
End Date - Start Date + IF(Start Date > End Date,1)
I can't attach the picture for some reason

Related

Google Sheets or Excel Function to return date based on value

I have this table in Google Sheets (or excel). The year is the two last digit of my code.
Code Duration Months
1 AC-26482-17 60
2 AC-26482-18 30
3
I would like to return the date in this format (If no data, just leave blanks).
Code Duration Months Start Expiration
1 AC-26482-17 60 01/01/2017 01/01/2022
2 AC-26482-18 30 01/01/2018 01/07/2020
3
Is there a way to achieve this?
You mean you want to add the duration in months to the start date? If so, your sample has the wrong expiration date. 30 months added to 1/1/2018 is not June 1st, but July 1st.
The formula in Excel is
=EDATE(C2,B2)
If you also want to calculate the start date from the last two characters of the code, given all dates are in this millennium, then you can use this for the start date:
=DATE(RIGHT(A2,2)+2000,1,1)
edit: To handle blank cells, you can check with IsBlank()
=if(isblank(a2),"",DATE(RIGHT(A2,2)+2000,1,1))
use:
=ARRAYFORMULA(IF(A2:A="",,DATE(IF(RIGHT(A2:A, 2)*1>=40,,20)&RIGHT(A2:A, 2), 1, 1)))
=ARRAYFORMULA(IF(A2:A="",,DATE(YEAR(C2:C), MONTH(C2:C)+B2:B, 1)))

How to split the time between two dates over daily columns

I am in much need of help please.
I have the table below.
It has about 300 rows and columns on the right for each day of the year starting 2015, ending 2019. I only entered a few columns here as an example.
What I need:
A formula to split the time (it can be hours or decimal days, it doesn't matter) between the two days on the left on the columns to the right.
In the rest of the days, which are not included in the period, I need a zero in those columns.
I manually entered the results I need so it can help you understand.
E.g.
On the first row:
The employee has spent
15 hours at destination in the first day of travel,
24 hours in the second day of travel
11:50 hours in the last day of travel.
All the rest of the columns to the right, which are not here, starting 1/4/2015 23:59 should give the result zero.
Thank You!!
Entry Date Exit Date 1/1/2015 23:59 1/2/2015 23:59 1/3/2015 23:59
1/1/15 9:00 1/3/15 11:50 15.00 24.00 11.50
As far as I can tell, it boils down to this
1.0 days 2.0 days 3.0 days 4.0 days
period=p in h/d.d p-(1-(so far)) p-(2-(so far)) p-(3-(so far)) 0
EDIT 2: I've come up with a formula.
NOTE:
This formula assumes existence of a column that specifies 0 hours of work between the "end date/time" column ("B") and first work hour ("D"), so you have it like this:
A B C D E F G H
1 Entry Date Exit Date ZERO 1/1/2015 23:59 1/2/2015 23:59 1/3/2015 23:59 1/4/2015 23:59 1/5/2015 23:59
2 1/1/15 9:00 1/3/2015 11:50 0 0.6243055556 1 0.49375 0 0.00
3
The extra column is there to avoid circular dependencies, since
we must "iteratively" accumulate the hours
The main formula for row 2 from column D being:
=MIN(D1-$A2,MIN(MAX(($B2-$A2) - SUM($C2:C2), 0),1))
Note: semicolons may be needed instead of commas in Excel as delimiters.
Note: the last digit in the formula depends on the unit. Here it is in days decimal. If hours, put 24.
In plain English, for a cell
Calculate sum of hours/days decimal in the range C to wherever - 1
Subtract result from the difference between start and end (total hours)
If less than 0, put 0 (MAX(x, 0))
If more than 1, put 1 (MIN(x, 1))
Choose between the result, or the difference between current date and start time, if it is smaller

Excel Time Comparison and Subtraction

I am trying to do a time subtraction in excel of 30 minutes and I am running into a speed bump. So the table I have are as follows.
Table "Schedule"
Column 1 is day of the week (Mon-Sun) (formated as general, as this is plain text)
Column 2 is start time of the shift (formated as h:mm AM/PM)
Column 3 is end time of the shift (formated as h:mm AM/PM)
Column 4 is duration of the shift (start to end) (formated by formula (TEXT(col3-col2,"h:mm")) )
Column 5 is paid hours (if the total hours is over 6.5 then subtract 0.5 hours for an unpaid lunch) (formula IF(col5>"6:30",col5-"0:30",D5) )
The issue is any time allotment over 10 hours start to end (where column 4, the duration hits 10 hours) no lunch is subtracted at all.
So...
Start 9:00 AM, End 6:59 PM, Hours Total 9:59, Hours Paid 9:29
But...
Start 9:00 AM, End 7:00 PM, Hours Total 10:00, Hours Paid 10:00
and that should obviously not happen. I can't find anything on google so I figured the excel gurus here may have some advice.
Thanks!
If your time columns are stores using excel's dedicated time format, this should be straightforward. Mixed data types are likely your problem.
First, be sure your time columns (columns 2 and 3) are set using the time function, i.e.,
=time(hours,minutes,seconds)
Then, you should be able to add and subtract easily.
Column 4: = column 3 - column 2
... then subtract 30 minutes also using the time() function:
Column 5: = if(column 4 > time(6,30,0),column 4 -time(0,30,0),column 4)
Excel stores time values from 0 to 1. So 24 hours=1, 12 hours=.5 etc. That means 6.5 hours=0.270833333 and .5 hours=0.020833333. As a result you can just do a simple if statement.
=IF(D2>0.270833333,D2-0.020833333,D2)
To turn it into a time format, is to just use excel's time formating options.

Creating a Timesheet with at different rates

Scenario:
I have an excel Timesheet which needs to calculate Standard Time 1x, Overtime 1.5x, Overtime 2x based on the following values:
If the start time and finish time fall between 08:00 and 16:45, then sum the hours x1
If the finish time falls between 16:45 and 00:00, then sum the hours by x1.5
If the finish time falls between 00:00 and 08:00 then sum hours by x2
Example Data:
Start time Finish time Standard time Overtime x1.5 Overtime x2
08:30:00 17:00:00 7.5 0.5 0
17:00:00 01:00:00 0 7 1
01:00:00 10:00:00 2 0 7
06:00:00 12:00:00 4 0 2
I have been racking my brain and possible ways to do this but keep falling short, does anybody know how I would go about creating a formula to do this kind of some?
Ah, I am too late as the other answer has been accepted which is great if it covers a 48-hour period. Anyway this is how mine looks - can provide some explanation later.
Here are the definitions relative to cell D2
So the basic formula is
=MAX(0,MIN(ClockOff+Split,ShiftEnd)-MAX(ClockOn,ShiftStart))
This is based on the standard formula for calculating the overlap of two ranges quoted in various places e.g. here but adds 1 (equal to one whole day) for the case when the end of shift is after midnight. This works for standard time (starting in D2) and overtime X 1.5 (starting in E2) as long as the end of the evening shift (in J4) is also entered as 1 whole day (24:00 hours). For overtime X 2, both the start of shift (0:00) and end of shift (08:00) have to be adjusted by 24 hours if the hours worked are split across midnight so the formula in F2 is
=MAX(0,MIN(ClockOff+Split,ShiftEnd+Split)-MAX(ClockOn,ShiftStart+Split))
Create a matrix of times and use an if statement to determine if the time falls within the shift or not. Sum the times as required for each shift.
Here's a link to my example http://www.scotlang.com/Overtime.xlsx.

Difference between two dates in excel 2013

I want to calculate the time difference between two dates with the following criteria:
1) excluding sundays and public holidays
2) TIMING: Mon to Fri = 7 AM to 7 PM &
Sat = 7 AM to 3 PM
I tried a many formulas and nothing works for me.
please any ideas??
Eg: Start Time: 3/6/2015 10:00 AM
End Time: 4/6/2015 12:00 PM
Then I should get the difference as 13 hrs (excluding time out of business hours)
If start and end "timestamps" will always be within working hours then you can use a formula like this:
=(SUM(NETWORKDAYS.INTL(A2,B2,{1,"1111101"},H$2:H$10)*{12,8})-IF(WEEKDAY(B2)=7,8,12))/24+MOD(B2,1)-MOD(A2,1)
Assuming start date/time in A2, end date/time in B2 and holiday list in H2:H10
Format result cell as [h]:mm and if start time is today (Monday) at 14:00 and end time is exactly a week later you will get the result 68:00 (5*12 hour days and 1*8 hour Saturday)

Resources