I am trying produce a burn chart in google sheets to record time remaining on a project, which has to be formatted as 'duration' but any data over 24 hours plots incorrectly.
It seems to be wrapping values over 24 hours back on themselves, so for example 30:00:00 plots at 06:00:00 (which is 30-24). So it seems to be treating the 'duration' as if they're numbers on a clock when I need them to work as normal numbers - i.e. go over 24 hours.
Here's the Sheet
and a screenshot:
Can anyone help?
It seems you found a bug in Google Sheets, googling for the problem finds other people with the same issue, e.g. here: https://productforums.google.com/forum/#!topic/docs/tf_ehe6J-CU
The workaround is to multiply the values by 24 to get the hours as a number. It will not be perfect, as it will show fractions of an hour after the dot, instead of proper minutes (you could implement a text formula to get the minute values e.g. as data point values if you really want to, but probably not on the Y axis). For most real life projects I'm guessing that should be good enough.
Related
I am trying to calculate the total number of minutes spent in bed overnight by inputting the time entered bed (e.g. 9pm) and time exited bed (e.g. 6am).
Using those example inputs, the answer should be 9hours, or 540minutes (9*60).
Instead, my formula counts backwards, grabbing the duration from 6am to 9pm which is 15hours, or 900min.
Here is what I have so far. The formula on F2 works just fine until you cross midnight in C2. For example, if B2 is 9pm and C2 is 11pm, F2 is 120minutes. Once you change C2 to 12pm (0:00 in 24hour notation), the calculation flips and becomes 540minutes.
I'm thinking since the cells like to count backwards, I could maybe take 24 hours and subtract it by the value in F2, effectively getting back the other portion?
I stumbled into a weird pseudo-fix: if B2 is 21:00 (9pm) and I put 30:00 into C2, C2 displays 6:00 and F2 counts properly. Here is what that looks like. I am hoping to find a better solution than this-- the UX i'm looking to achieve is just putting my bed time and my wake time and the cells do the rest.
Thanks in advance!!
Drop the abs.
C2-B2
already assumes next day when C2<B2 as shown here:
The reason it works is that Google Sheet treats those as (duration of) time. And when displaying time, the "minus amount" is converted to a positive time value that represents a time of the previous day, as if modulus 24 hours. For example, 7:00 (hour) minus 21:00 (hour) gives -14:00 (hour) and it will be displayed as 24:00 (hour) - 14:00 (hour) = 10:00 (hour). Thus it is equivalent to the number you are looking for. However, modulus 24 hours effect is only for display. The minus sign is still inherent to the resultant value.
In order to display minutes or do other calculations with the result, you can wrap it with timevalue(). With that, the underlying value will be converted as described above.
To then display minutes, you can format the cell to display Elapsed minutes using the steps shown below.
And you will see minutes in the cell as shown below.
Your question implies that you may desire to do calculations on the result.
If that is that case, it helps to know that the output of timevalue is time duration in (fractions of) days without any inherent formatting. If not, you may skip the followings.
For example, in the preceding image, if you put =C1*2 in D1, with automatic formatting, D1 will inherit the format of C1, which was Elapsed minutes. You will thus see 1440. However, the actual underlying value is 1 because the real meaning of the data is half a day times 2. And you can confirm that by setting the format of D1 as numbers.
Thus, if you are only doing calculations with outputs of timevalue, you are fine without worrying about the above. However, if you mix the result of timevalue with other types of data, the fraction of day meaning is what will be used in your calculations.
I have a spreadsheet that receives data from an RPA, this data is HH:MM, the output is based on how long a task has taken to perform.
example:
Project
Time
Task 1
2:35
Task 2
3:45
Where 2:35 is equal to 2 hours and 35 minutes.
The issue that i am having is that when I add these numbers google sheets displays it as 5:80, where it should be 6:20, as that is the actual amount of hours and minutes represented in the table. In other words I would like the decimal counter to stop at 60 and add new, not at a 100?
Anybody have an idea of how to achieve this? :)
-- Toby
In order for the duration formatting to work the delimeter must be the correct standard according to the language you are working in.
this is potentially really simple but I have been looking at it for ages, which may be the problem.
I am looking at log in times on a phone system v the times when calls are incoming. The spreadsheet breaks down the phone hours by minute and then checks the times someone logged in and displays if they were logged in at any given minute.
Then the data from incoming calls is pasted in which is converted into timestamps and compared.
The problem is a bit odd because it correctly counts from 9:30 to around 15:00 but then does not count entries after that time.
Here is a link to the spreadsheet copy I have made.
Any help would be appreciated. As I said it's probably really simple but often when you have looked at something too long you miss obvious things.
The problem is due to rounding errors
For example, both cell H72 and MK11 have the display value 15:05:00.
However, if you visualize the real value of the cells, e.g. by Paste values only into a cell formatted as a number you will see:
The exact value of cell H72 is 0.628472222222222
The exact value of cell MK11 is 0.628472222222221
This rounding error was not obvious for the first rows / columns but it kept propagating through the data until the point of becoming big enough to change 15th decimal position.
The reason is that Google Sheets stores numbers as 64 bit signed floating points which limits the precision to the 15th decimal position and thus rounding errors will not become obvious as long as they are smaller than this.
Solution
Given that you use the formula
=ROUNDUP(F12*1440/1,0)*1/1440
on column H for the call list, you should do the same for the incoming rows in row 9, so
=ROUNDUP(1440*(N11+time(0,1,0)))/1440
and so on.
I have a cell with a duration type field that is marking 25:30:00. I need to convert this to a decimal type of hours. So I would need 25.5 hours. However I cannot find any way of getting the number of hours from the field. Splitting the string by : does not work in a custom function neither does the function HOUR. So how can I do this.
PD: I've found this question How do I get the number of days for a duration where the number of hours exceeds 24 in google sheets? which seems very close to what I want but I can't figure out how to adapt it to my needs. Any help would be apprecaited.
Duration is represented in Google Sheets by a number that measures the duration in days. (You can see this by changing the format of a cell with duration to a number.) This is why multiplying it by 24, as pnuts suggested, gives the duration expressed in hours. I'd suggest also using N to make the result explicitly a number:
=N(A2*24)
(Assuming duration is in A2). This should eliminate the need to manually format the output as a number.
I've tried doing a custom format, but don't have any luck. I always get a divide by zero error. Ideally, I'd be able to average "1:00.0, 1:30.00, and 2:00.00" and have the function return "90.0" OR "1:30.0"
Can someone help me convert the times into values that the average function can understand?
This is in Google Sheets
Assuming 1:00.0 is in A1, 1:30.00 in A2 etc. The mix of : and , seems not to be accepted as a number format for data entry, so your data is presumably strings. These need first to be converted to numbers. This might be achieved with something like:
=ArrayFormula(value("0:"&A1:A100))
in B1. It not only assumes you have 100 rows of data but also that your data points do not individually equal or exceed one hour unless expressed as 60 minutes or more.
You may want to format the results with Format – Number, More Formats, Custom number format…:
mm:ss.000
though in this format hours are not shown.
In that format the result of:
=average(B1:B3)
should be:
01:30.000
Might not work in old Google Sheets.