I want to do quick calculations in Excel. I have a cell (A1) with 50:00:00. I do =A1+1 and get 74:00:00. So, I guess 1=24 hours=1 day. However, I try =A1+1:23:45 and get an error. Is there an easy way to add hours to hours in Excel? If not, do you have a better tool?
Please don't say something like =A1+1/24+23/24/60+45/24/60/60. That's not easy in my book.
Just use =A1+Time(1,23,45) for this.
You can use the Time function which takes as parameters, hour, minute, seconds, respectively.
So to ad 1 hour to the date in A1, you would type = A1 + Time(1,0,0)
Related
Have an excel question. I am looking to see if something states "complete" in one cell and if yes then look at a date in another cell and then count how many are within 30 day period of today's date. Below I know its wrong but might be able to get a better idea of what I am trying to do.
=sumifs(Main!B:B="Completed",Main!H:H,"<30")
You should be using COUNTIFS:
For 30 days window in the future:
=COUNTIFS(Main!B:B,"Completed",Main!I:I,">="&TODAY(),Main!I:I,"<"&TODAY()+30)
For 30 days window in the Past:
=COUNTIFS(Main!B:B,"Completed",Main!I:I,"<"&TODAY()+1,Main!I:I,">="&TODAY()-30)
=COUNTIFS(Main!B:B,"Completed",Main!H:H,"<="&TODAY(),Main!H:H,"<"&TODAY()+30)
Consider the following table of employees.
It's fairly simple right? Clock in when you start, clock out for lunch, clock back in after lunch, clock out when you leave. But can someone please tell me what time these employees actually started? So for example how would you go about saying Tom was here at 6:51 AM and not at 12:23 PM?
For more reference, all entries look like this. They have at least 4 entries, (some one, no lunch).
How do I go about writing a formula that returns the start time?
I edited the table and added a helper column for the date. See below.
ANSWER:
=AGGREGATE(15,6, $C$2:$C$7/((A11=$A$2:$A$7)*(B11=$B$2:$B$7)),1)
If the working hours are within the day, you can search for the smallest time. If there is a night shift over midnight, then there is a problem ...
=AGGREGATE(15,6,(1/($A$2:$A$5=A2)*(INT(B2)=INT($B$2:$B$5)))*($B$2:$B$5),1)
I've written down this formula for range E2:
=IF(AND(A2=A3,TRUNC(B2,0)-TRUNC(B3,0)=0),MIN(B2,B3),IF(AND(IFERROR(TRUNC(B2)-TRUNC(B1)=0,FALSE),E1=MIN(B2,B1)),"",B2))"
Since english is not my default language on Excel, i've just manually translated it. Anyway, just in case, here is the VBA code to paste it in range E2:
Range("E2").FormulaR1C1 = "=IF(AND(RC[-4]=R[1]C[-4],TRUNC(RC[-3],0)-TRUNC(R[1]C[-3],0)=0),MIN(RC[-3],R[1]C[-3]),IF(AND(IFERROR(TRUNC(RC[-3])-TRUNC(R[-1]C[-3])=0,FALSE),R[-1]C=MIN(RC[-3],R[-1]C[-3])),"""",RC[-3]))"
I've tried various configurations and it works for me. Only point: list must be sorted by Name and Clock In.
I have a spreadsheet which has employee working times, listed as Sat-In and Sat-Out for a specific date. The employee shift spans several ours and each "In-Out" period is recorded as a separate line which means the time between the Sat-Out and the next Sat-In means the employee is on a break. I also calculate the time, in minutes of each "sitting" period.
What I can't seem to figure out is how to add a formula which takes the data and further refines it in this manner:
1. I have a core period of 1030-1530, as an example, which is the busy time and requires the maximum employee coverage. The shifts of employees generally spans this core, but in some cases their shift may start or end in the core.
2. I want to calculate how many minutes the employee worked within the core only. I can obviously do this manually using the data, but a formula would be preferred, if possible.
3. As an example, if a person sat-in at 1445 and sat-out at 1545, the core time calculation would be 45 minutes (1445-1530).
I've attached a snapshot of the data to help my explanation.
FYI - the information is pulled from a database as JSON data and converted to excel. I'm not very familiar with JavaScript, but if someone knows a way to do it programatically, I'm willing to give it a try and learn.
Thanks!
![excel]: https://photos.app.goo.gl/dRSTE72CXNa18RzP8
In below example I've used: =MAX(0,MIN($O$2,H2)-MAX($O$1,G2)), and formatted like [mm].
In Excel, units are days, so if you want to calculate the amount of minutes between two timestamps, you need to subtract both and multiply the differencee by 24*60 (being the amount of minutes in one day).
E.g. You start working at 09:07 (cell B2), and finish at 18:07 (cell B3), having a 45-minutes break. Then the time you worked in minutes, is:
=(B3-B2)*24*60-45
Make sure the cell formatting is correct (general), you'll get : 495.
I just want to ask if it's possible to make a formula that will result to a final time that I need? If possible, how can I do it?
For example, if a time is after business hours today, the formula should add a certain number of hours to have a result of 8AM the following day, else, add zero hours. Consider this as a reverse of time difference formula.
Thanks in advance. Just need this to set SLA deadlines for work.
Hope this helps for you, Please alter working hours in the formula per your needs,
Formula,
=TEXT(IF(AND(D2>TIME(8,0,0),D2<TIME(17,0,0)),D2,TIME(8,0,0)),"hh:mm")
I'm doing a report which calculates people's time to determine their pay. We pull reports from our servers and paste them into Excel to do the calculations. I have run into an issue when pulling the data: if the time they logged in for was less than an hour our formula is not working:
=IF(E159="","",((HOUR(E159)+(MINUTE(E159)+(SECOND(E159)/60))/60)))
This gives an error (#value) if the time is :34:15, but if it's 00:34:15 then it's fine.
Formatting the cell does not appear to work.
I'd like to go through this column and add the 00 to all values missing it, and I need some help or guidance from there.
Another question on SO looks like it may help, but I'm unsure on how to use it.
Assuming that The tiem is in cell E159 from your above formula, you can append a 0 to the start of the time. This will fix all the times that have the hour missing and won't affect the other lines.
="0"&E159
You can then replace all of the E159 references in your original formula with this edit so that it looks like this:
=IF(E159="","",((HOUR("0"&E159)+(MINUTE("0"&E159)+(SECOND("0"&E159)/60))/60)))
While it's hard to read, it does the trick.
While that answers you question.. I think that there is a better way to achieve this formula.
It looks like the end result you're looking for is the time converted to hours, with mulutes and seconds as a decimel to the next hour. You can achieve this by doing:
=E159*24
Which will give you the same result as your original formula.
And then to combine that with my first answer to get a formula that looks like:
=("0" & E159)*24
This approach is much easier to read / edit and provides the same output.
Why This Works
Excel stores all dates as whole numbers, and all times as a decimel % to a day.
So when Excel is stores 12 hours it saves it as .5 because it is half of a day.
By dividing the time output by 24 we are converting the entire time value down from a % of day to a % of hours.