Time/hour calculation in excel - excel

I’m so rusty on excel and I’m trying to work out a formula for this problem:
Shifts greater than 5 hours duration must take a 1 hour unpaid break.
I’m using for G5 =IF(G4>5:00:00,”1:00:00”,”0:00:00”)
G4 =shift duration, cell is formatted as [h]:mm
Once I get this to work I then add G4 and G5 and to get the shift finish time.
It sounds so simple but it’s driving me crazy!!! Any help would be appreciated!

Excel stores time field internally as numbers, where 1 is a complete day (which is 24 hours).
If G4 has the value "06:30" (a time ), Then a formula in G5 like this:
=G4*24, will give you the numeric value 6.5.
You formula to check for more than 5 hours can be:
IF(G4*24>5,"01:00:00","00:00:00")
But this will return a text (i.e.:"01:00:00"). This can be solved by adding the function TIMEVALUE()
=TIMEVALUE(IF(G4*24>5,"01:00:00","00:00:00"))
EDIT:
Another way can be:
=IF(G4>TIME(5,0,0),"01:00:00","00:00:00")

Related

formula to find the difference between time with a conditions

I'm trying to make a formula to find the difference between 2 time, and also have a condition like this :
If work time > 8 hours, then the difference from work time become the overtime
And here's the image of my table in Excel :
the table
Can you please tell me what to write the formula?
Formula for worktime
=F2-E2
Formula for Overtime
=MAX(G2-(1/3),0)
If you would like the work time and overtime to be formatted as number (e.g 1 instead of 1:00), use the formulas below and format your cells to be numbers
=(F2-E2)*24
=MAX(G2-8,0)

time sheet overtime hours add up

This is basically about overtime calculations, but I want it calculated separately. IF(A1>8,A1-8,0)
I want A1 when it reaches 8, to flow over to I1. Now I know this formula...
But additionally I would also like B1, C1, and D1 to do the same. So what I'm saying is that each of those cells when a value above 8 is input, I would like it to flow into I1 aswell. That's one part of it, also I would like any amount that is input to cells E1, F1, and G1 to flow into I1 . The final 3 cells are basically weekend work and considered by my company as overtime.
=SUMPRODUCT((A11:G11>H3:N3)*(A11:G11-H3:N3))
So this one works guys but, what I want to do is grab from two separate rows for the seven days of the week. Like this.....
=SUMPRODUCT((D11:G11,A13:C13>H3:N3)*(D11:G11,A13:C13-H3:N3))
But what I'm getting now is #VALUE! I'm not sure what I'm doing wrong.
I would like to know if this is possible and will greatly appreciate the help solving this problem.
So Seeming no one answered you guys decided to minus my rep, I stumbled on the answer myself. I worked this out by making a table with each day and the hours of single time in them.
For the purpose of this formula below I'll say K3 is Sunday and that D19 is also the hours worked on the Sunday. It tells the cell to compare the number input to D19 and if greater than, then minus what is in K3 and return the value in the cell I have input the formula. Because this is for overtime I wanted it to add up each day separately and give me a running total through the week. This Formula worked perfectly for me.
=SUM((D19>$K$3)(D19-$K$3),(O11>$L$3)(O11-$L$3),(P11>$M$3)(P11-$M$3),(Q11>$N$3)(Q11-$N$3),(K13>$H$3)(K13-$H$3),(L13>$I$3)(L13-$I$3),(M13>$J$3)*(M13-$J$3))
Feel free to copy and paste and change it to suit your needs.

Calculate time in Excel by exact time

I have a cell A3 as 10.55 and B3 as 20.35. Now i have to calculate the different value as time. It means i should get the value like 9 hours and 40 mins. it should print like 9.40 in the C3.
I have tried this but it is not give the exact value.
=TIME(FLOOR((B3-A3), 1), ((B3-A3) - FLOOR((B3-A3), 1)) * 100, 0)
Is there any other way to solve it ? Thank you in advance.
If you use the native Excel time format 10:55 and 20:35 instead, you can simply do a substraction to get your desired result.
A3:
=TIME(10;55;00)
B3:
=TIME(20;35;00)
C3:
=TEXT(B3-A3;"g.mm")
Should work. ;)
First, you need to set the number format in all 3 cells as h.mm (Right click on cells, Format Cells..., Number tab, Custom category).
Then, when you enter the time it should be in the standard format 10:55, otherwise it will be consider as number, indeed. Why this happens: MS Excel consider all dates as numbers. The integer part are the number of days since 1900, the fractional part are the hours. The difference between number and date is only the number format as number or as date/time.
If you do like this, if simply use the formula =B3-A3, you will get the time difference.

Getting minutes between different dates in excel

I'm trying to calculate the time between the dates , at the beginning the formula
was working fine but I've noticed that it does not work when the date is different
For example , I have the following information on cell A1: 09/15/2016 10:00 AM
On Cell B2 I have: 09/16/2016 10:00 AM
The formula is just B2-A1 but instead of giving me a result of 24 hours is just giving me 0 . I believe the formula is not recognizing that these are 2 different days and is just doing 10-10
Any idea how to fix this ?
I was able to get the result 24 by setting a custom format of [h] (you will have to type it into the 'Type:' box) on cell C1 while using the formula =B1-A1
Excel Reference
'Format Cells' view
The problem with just using =B1-A1 is that if either or both of those cells is not populated then you will get weird numbers in C1. You may want to make C1 display as a blank cell unless both boxes are populated, try something like this =IF(OR(ISBLANK(A1),ISBLANK(B1)),"",B1-A1)
The reason for the weird numbers is that Excel calculates time based on a predefined decimal system that indexes time starting at like 1/1/1900 or something like that. So when manipulating or calculating time, that is something that you always have to keep in the back of your mind.
Hope this helps.
Formation the destination cell to will do but since you have date and time combined it will show as 1 calendar day difference 0 only means that 12 am after the 1 day difference, I know it does not make any sense but its Excel...
If I was you, on column A, I would add the date, and on Column B, the time.
then just work with the time, as both combined can be tricky
Don't forget to format your cells!! (right click>Format Cells>Time>3/14/12 1:30 PM)

Calculating time difference between [h]:mm

I've got 2 fields in Excel that are formatted as [h]:mm and I need to find the value difference between them.
For example in G2 I have 4217:11 and in I2 I have 1703:11.
I know that the answer should be 2514:00 as it is 4217 hours 11 minutes minutes 1703 hours 11 minutes, however I can't figure out how to do this in Excel.
I've tried the simple minus formula, however I get a #VALUE error.
Any suggestions?
I just tried =G2-I2 and it worked fine for me ... if you're getting #VALUE error, then the data definitely isn't formatted like you think. Likely it's being formatted as text, and it just "looks" like it's in a time format.
One way to do it is to create a formula that rebuilds the value to what you want.
But it requires helper columns.
In J2 (or whichever is free)
=LEFT(G2;FIND(":";G2)-1)&":"&MID(G2;FIND(":";G2)+1;2)
In K2 (or whichever is free)
=LEFT(I2;FIND(":";I2)-1)&":"&MID(I2;FIND(":";I2)+1;2)
The above formulas will make text to the type of string you want.
Then in the next free column set the formating to [t]:mm as you said before and just do a =J2-K2
Sorry for the swedish but the formulas are above

Resources