Reducing duration by a percentage in excel - 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.

Related

Subtracting times across a day in excel

I am working on the capstone project in of the Google Career Certificate in Data Analytics. I am using Microsoft Excel. I have to calculate the ride length based on the start and end ride times. I've inputted the formula =F2(end time)-D2(start time) which returns the ride length. Going through my entire list I have some areas where the start time is like 11pm and the end time is 1am and this is returning ###### because it is a negative number with the regular formula. I've found a modified formula that can kind of do the conversion I am looking for but it is still a bit problematic. The modified formula is =(F2-D2+(F2<D2))*24 and it seems to give an accurate ride length if I reformat the answer to number. The issue is the rest of my data is in time format and the modified ones are in number format. If I convert the number values to time, the ride length values are inaccurate.
It is tricky to make the numeric value change as well due to me using a formula. I can correct them one by one after I save Excel and it no longer stores the numbers as the formula, but there are lots of data points to change and that would be time consuming. I'm hoping to find a more concise way to solve this problem. Maybe with a better formula.
[Snippet of the chart 1
Just like everything in life, there are multiple ways to achieve things. I would have formatted the date and time into a single cell; but. if you're gathering the data from another source, that's understandable.
A simple IF statement here will work. IF the days are one apart, then take '1' day off the starting time, else do your original formula:
=IF(E4-C4=1,F4-(D4-1),F4-D4)

Excel: How to subtract the number of hours of a date such as "2022-07-18 17:40:02.878981+00:00" - "2022-07-18 17:03:41.638306+00:00"?

Before going any further, please note that I have very poor knowledge in Excel, and that 99.99% of the time I have to search on the internet to achieve the simplest things in Excel; although I have to use it for "simple" calculations.
Be assured that I have already gone through this and to many try and tests.
I have a table similar to this:
I want to subtract the values of "Discovery End Time" to the "Discovery Start Time" in a third column in order to find the duration of an action.
I do not care at all about the gibberish after yyyy-mm-dd hh:mm:ss in the calculation. It should not appear in the column duration.
I have tried many things, such as what is on this page but failed until now.
Any hints please?
The problem is all the extra information after yyyy-mm-dd hh:mm:ss.000 which it the max accuracy of Excel. So we just use the left 19 characters, since you do not care about the decimal seconds.
=LEFT(B2,19)-LEFT(A2,19)
This will probably return a double. You will need to format the cell as desired: [hh]:mm:ss

Excell 2016 - Is this average time correct?

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).

How to convert two time formats into one?

I am pulling Cross Country race times, and trying to convert the race time into an integer that can be easier to work with.
I am using the formula
=([Cell Name]-INT([Cell Name])*60*24
But I am so far retrieving two different time formats:
17:23.4
15:09
Both formats take that formula differently, and they are producing different numbers. The first format is changed into 17 minutes, but the other is turned into 1000+ minutes. Is there a way that I can convert these times into one format?
The main problem you are having is as tom sharpe pointed out is that some times are being assessed as HH:MM and others as MM:SS. if you look at your source data cell (assmue A2) and use the following formula it will tell you if you are dealing with text or time in excel serial date time formatted to appear in a manner we are used to seeing:
=ISTEXT(A2)
now assuming that the result is TRUE, this means you are dealing with TEXT. Adding a leading 0: to the text will make the time recognizable to excel as being in the format HH:MM:SS and allow for you to deal with it consistently.
To do this use the following formula:
=timevalue("0:"&A2)
Things may get a little wonky if ou have anything greater than or equal to 60 as the first two digits.
once you have it in the proper format you can then use it in your formula.

Chart or in Excel From List of Timestamps

I have a program that writes the currenct time to excel when a process is called, so I have an excel file with one column of over 5000 timestamps in HH(24):MM:SS format. I'm trying to visualize these over a 24 hour period in order to find a time where the process is least likely to occur. Can anyone get me started?
Thanks
Simply selecting the data in your column and Insert > Charts – Scatter, Scatter with only Markers might suit. The closer the markers to one another (or the shallower the slope) should indicate the process has been called often in a short time interval. ie the quieter periods are when the slope is steep.
If not a very helpful visualisation then maybe count the number of starts over intervals of fixed length (create ‘bins’) and plot a histogram. “a time where the process is least likely to occur” implies that not only start time but duration may be relevant. In which case an an interval of approximately the average duration may be useful.
If you give Excel a column of timestamps in a format it understands, it can map them to a fraction representing how far into the day that timestamp is. For example, if you paste in "12:00:00" and then format that cell as a number, you will get 0.5. Likewise 06:00:00 to 0.25, etc. These numbers can then be plotted on a histogram by following these steps.
Caveat: Only confirmed this works in Excel 2013.

Resources