Excell 2016 - Is this average time correct? - excel

So I am trying to find my average time in Excel and I have been using the average function but even though I do not know what the exact value should be I know that what was being returned was way off. So I googled Excel time format and followed the instructions and changed my time from MM:SS format to H:MM:SS format; because the article said that way I am guaranteed to get correct averages when I use Excel's native average function.
However, I am running Excels average function on mixed values like the below:
1:20:30
0:04:00
0:00:30
0:00:05
--------
Average: 0:21:16
Can someone just please share their expertise with me and verify that the above average calculation is correct that I obtained by just easily using Excel's native average function.
I just want to be sure before I change everything on my spreadsheet.

Working with times and their various formats/representations can be tricky in Excel - sometimes I convert to serial and then multiply by 24 to ascertain the number of hours in the day, other times not. In your case, this appears to be straight forward and can easily be verified.
Here/screenshot refer:
Mathematically: you can determine the number of hours, minutes, seconds directly from what you have using respective equations as follows:
=hour(E4)
=minute(E4)
=second(E4)
Determining the average is then a trivial exercise by summing and dividing by the count (4), which reconciles (as can be seen).
Let's apply logic too: average of 21 mins looks about right - consider equivalent scenario of average running time for 4 athletes, where one of them takes 80 mins and the others take under 5 each - average time will be around 20 mins (~80/4).

Related

Calculate minutes in specific period

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.

Reducing duration by a percentage in excel

I have been racking my brain for hours on how to do this, so I am reaching out to some of you excel experts.
Say you have a duration represented as 1d 14:25:00 and you want to reduce that by a given percent, such as 149.5%, how can this be done?
At first I thought about going down the route of having a cell formatted in time, but when you try and do math against it, it fails.
Then I thought about maybe converting the time down to seconds and working with that, but that seems like it is total pain in the rear. It involves a lot of converting from time to number then back to time to display it. There has to be an easier way.
It depends on how you format the cell to read the Date/Time. If it's represented as a Time, then I believe the best approach is to convert the percentage into a decimal number (i.e 150% = 1.5), then use that in your formula.
However, it also requires applying the cell format to the custom format of [h]:mm:ss to include any times above 24 hours. See the image below for an example.
Time Conversion Example:
The only alternative is a "pain in the rear" - breaking the time down into seconds.
Excel includes built-in functions to convert a Date/Time into HOUR(date), MINUTE(date), and SECOND(date). Unfortunately, getting the number of days requires calculating the difference between two times: DAYS(end_date, start_date). I used this in the example above for the rows titled Conversion.

Multiplying different number formats in Excel

I'm using an excel document to track my hours at work (this is my 3rd question about it)
I'm trying to figure out how to multiply a time (i.e. 62:05, which is how long I have worked for over 2 weeks), by my hourly rate (11$/hr) and get approximate gross earnings in this format: $667.43
my time format is [hh]:mm and the 11/hr format doesn't do anything other than the total being 29.0000382 something.
Consider this formula:
=A1*24*B1

Excel - Evaluate multiple cells in a row and create report or display showing lowest to highest

In an Excel 2003 spreadsheet, I have the top row of cells calculating the number of days and hours I have worked on something based on data I put in the cells below for each category. For example I enter the time spent on Programming, Spoken languages, house, piano, guitar...etc. The top cell in each category will keep track of and display how many days and hours I spent as I add the time spent for each category each day. I want to evaluate this top row and then list in a "report" (like a pop up box or another tab or something) in order from least amount of time to the most amount of time. This is so I can see at a glance which category is falling behind and what I need to work on. Can this be done in Excel? VBA? Or do I have to write a program from scratch in C# or Java? Thanks!
VH
Unbelievable... I've been scolded for trying to understand an answer and requested to mark this question answered. I don't see anything to do this and could not find anything that tells you how, so I'm just writing it here. MY QUESTION WAS ANSWERED... But thanks anyway...
Consider the following screenshot:
The chart data is built with formulas in columns H3:I3 and below. The formulas are
H3 =INDEX($B$3:$F$3,MATCH(SMALL($B$2:$F$2,ROW(A1)),$B$2:$F$2,0))
I3 =INDEX($B$2:$F$2,MATCH(SMALL($B$2:$F$2,ROW(A1)),$B$2:$F$2,0))
Copy down and build a horizontal bar chart from the data. If you want to change the order of the source data, use LARGE() instead of SMALL().
Alternative Approach
Instead of recording your data in a matrix, consider recording in a flat table with columns for date, category and time spent. That data can then easily be evaluated in many possible ways without using any formulas at all. The screenshot below shows a pivot table and chart where the data is sorted by time spent.
Edit after inspecting file:
Swap rows 2 and 3. Then you can choose one of the approaches outlined above.
Consider entering the study time as time values. It is not immediately clear if your entry 2.23 means 2 hrs and 23 minutes, or 2 hrs plus 0.23 of an hour, which totals to 2hrs, 13 minutes.
If you are using the first method, then all your sums involving decimals are off. For example, the total for column B is 7.73 as you sum it. Is that meant to be 7 hrs and 73 minutes? That would really be 8 hrs and 13 minutes, no? Or is it meant to be 7 hrs and 43 minutes? You can see how this is confusing. Use the colon to separate hrs and minutes and - hey - you can see human readable time values and don't have to convert minute values into decimals.

How to get the difference in minutes between two dates in Microsoft Excel?

I am doing some work in Excel and am running into a bit of a problem. The instruments I am working with save the date and the time of the measurements and I can read this data into Excel with the following format:
A B
1 Date: Time:
2 12/11/12 2:36:25
3 12/12/12 1:46:14
What I am looking to do is find the difference in the two date/time stamps in mins so that I can create a decay curve from the data. So In Excel, I am looking to Make this (if the number of mins in this example is wrong I just calculated it by hand quickly):
A B C
1 Date: Time: Time Elapsed (Minutes)
2 12/11/12 2:36:25 -
3 12/12/12 1:46:14 1436.82
I Have looked around for a bit and found several methods for the difference in time but they always assume that the dates are the same. I exaggerated the time between my measurements some but that roll over of days is what is causing me grief. Any suggestions or hints as to how to go about this would be great. Even If I could find the difference between the date and times in hrs or days in a decimal format, I could just multiple by a constant to get my answer. Please note, I do have experience with programming and Excel but please explain in details. I sometimes get lost in steps.
time and date are both stored as numerical, decimal values (floating point actually). Dates are the whole numbers and time is the decimal part (1/24 = 1 hour, 1/24*1/60 is one minute etc...)
Date-time difference is calculated as:
date2-date1
time2-time1
which will give you the answer in days, now multiply by 24 (hours in day) and then by 60 (minutes in hour) and you are there:
time elapsed = ((date2-date1) + (time2-time1)) * 24 * 60
or
C3 = ((A3-A2)+(B3-B2))*24*60
To add a bit more perspective, Excel stores date and times as serial numbers.
Here is a Reference material to read up.
I would suggest you to use the following:
Combine date to it's time and then do the difference. So it will not cause you any issues of next day or anything.
Please refer to the image with calculations. You may leave your total minutes cell as general or number format.
MS EXCEL Article: Calculate the difference between two times
Example as per this article
Neat way to do this is:
=MOD(end-start,1)*24
where start and end are formatted as "09:00" and "17:00"
Midnight shift
If start and end time are on the same day the MOD function does not affect anything. If the end time crosses midnight, and the end is earlier then start (say you start 23PM and finish 1AM, so result is 2 hours), the MOD function flips the sign of the difference.
Note that this formula calculates the difference between two times (actually two dates) as decimal value. If you want to see the result as time, display the result as time (ctrl+shift+2).
https://exceljet.net/formula/time-difference-in-hours-as-decimal-value
get n day between two dates, by using days360 function =days360(dateA,dateB)
find minute with this formula using timeA as reference =(timeB-$timeA+n*"24:00")*1440
voila you get minutes between two time and dates
I think =TEXT(<cellA> - <cellB>; "[h]:mm:ss") is a more concise answer. This way, you can have your column as a datetime.

Resources