How to fill down time tracker if having only start & End MM:SS - excel

Having Excel where I get required hourly down time with only having start & end date time as per the images required any formula or vba command for calculation.

Please, notice you are mixing different types of data in your output. Value 03:39 is a time value while 60,0 or 0,0 is decimal. You should consider working all of them in decimal if you are going to make any calculations.
Also, you could play with CF rules to see the values as you wish, but real value should be decimals.
Anyways, I managed to do it with this:
=IF(HOUR($A2)>HOUR(C$1);0;IF(HOUR($A2)=HOUR(C$1);TEXT("00:"&MINUTE($A2)&":"&SECOND($A2);"mm:ss");IF(HOUR($B2)>HOUR(C$1);TEXT(60;"0,0");IF(HOUR($B2)=HOUR(C$1);TEXT("00:"&MINUTE($B2)&":"&SECOND($B2);"mm:ss");TEXT(0;"0,0")))))
Drag to right and bottom.
Notice I'm forcing the format with the TEXT function, so the output is not numeric but a text so you cannot do any calculus with it. That's why you should consider using CF rules
Also, depending on your regional setup, masks like mm:ss or 0,0 that I use in the formulas may be different in your PC

Related

Format integers as fraction

I have a list of fractions in Excel which I want to format as fractions, including integers. However, by default Excel formats integers as integers which is understandable.
Is there any way to force Excel to format, say, 4/4 as 4/4 instead of 1?
I need it to be stores as values and not as text, so '4/4 wont work. As I need to average a bunch of values from it afterwards.
Apparently I'm the first person ever to take issue with this, because google provides absolutely no help whatsoever :o
Yes, use a custom number format:
?/4
I don't believe what you are trying to accomplish is doable outright, as fractions are really division problems. However, with some formula trickery, you may be able to get something that will work for you.
If you place '7/8 in cell A1 and then use the following formula in cell B1
=DECIMAL(MID(A1,1,FIND("/",A1,1)-1),10)/DECIMAL(MID(A1,FIND("/",A1,1)+1,LEN(A1)),10)
The cell will display the decimal value of the "fraction", in this case 0.875 allowing you to change the denominator at will and still perform math functions.
This works because the formula slices up the "fraction" stored as text and converts it to a number and performs the math.

Conditional Formatting with Time through Formula

I'm trying to highlight the time based on the folowing rules
If the time is lower than 7:30 be closer to red
Otherwise if the time is closer to 8:05 get close to green
In this sheet:
I guess it's easier to explain with the following illustration:
You should get the basic idea of what I'm trying to accomplish with the formulars in the formatting rule picture. That one however doesn't work.
Any ideas what would be the proper way to format this rule?
On the left side for value write 0,31 and on the right side write 0,34.
To get the correct value, that is corresponding to the correct time, simply select the time in Excel, using the Time() formula, press Ctrl+1 and select Number. You will see the correct number for the time.
Also found a way, albeit this is more of a workaround:
You can enter the values as a raw number in format of AB:CD:EF (or depending on the time format you are using) and excel will automatically format the rule somehow with decimal signs, although this really is more of a workaround rather than answer to the actual question
You can use "industrial minutes", minutes to a base of 100 industrialseconds. Then you can use standard decimal values.
In excel you simple multiply time values by 24 to get to that. Then 30 minutes are 0.5 of an hour.
For the conditional formating use a 3-Color scale and set the middlepoint to number 7.5 and a lighter green.

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.

Wrong format of a cell in Excel

I am copying large tables from a website to Excel and it is copied in a wrong format. The number which I need seems to be in a cell but when I click into the cell it shows me that it is a date (and the number shown in the cell is its month and year).
Is it possible to change that so that the number in the cell will be 4.25 instead of 1.4.2025?
Thanks a lot.
You can change the format by highlighting the cells, right clicking selecting the format cells option. It will not change the string of numbers from 1.4.2025, but you will be able to replace the date format with something more appropriate for your needs. *
In the 1900 date system, 1.12 and 12.15 (for example) if entered as 1/12 and 12/15 respectively (where the locale has . as the decimal separator) into cells formatted General will show 01-Dec and Dec-15 respectively. The underlying number however (ie change format from Custom to Number) is 42339 for both. 42339 in Short Date format shows as 01/12/2015.
Although generally possible to deduce what malformed number gave rise to what looks like a date it is not always possible to do so. Ambiguity is greatest where the digits for the decimal or integer parts are less than 13. In addition, the locale in which the numbers were entered may play a part (since, in the 1900 date system, 3/4 for example would be interpreted as 42097 where the date convention is DMY 'UK' and 42067 where the date convention is MDY 'US').
So the answer to your question:
Is it possible to change that so that the number in the cell will be 4.25 instead of 1.4.2025?
is "Yes, but not fully reliably" (and even so would require knowledge or guessing of locale, date system and time of the conversion). Since you are "copying large tables from a website to Excel" it seem you retain access to the source data and I would recommend returning to that. On a small scale manual adjustments may be viable, on a large scale consider importing first to software without such automatic interpretation (eg Word, NotePad++) or, if possible, as character separated values imported as text. Address the delimiters with string handling there and only after that import to Excel or save in Excel format.

EXCEL - Substract two 24hr time format cells with seconds and miliseconds

Okay, so I have two cells:
Start End
11:31:37.644 11:31:51.269
I'd like to subtract the two and return the remaining time which should equal something around 14 seconds.
Edit for more information:
My values I'm inputting are like so:
113137.644
113151.269
and I have a custom formatter set to: 00\:00\:00.000 to display what you see at the very top.
It would be better if you could input the values as real time values then you can just use a simple subtraction
=A2-A1
...but with the values as they are you can do a conversion and subtraction all in one using TEXT function, e.g. in A3 use this formula
=TEXT(A2,"00\:00\:00.000")-TEXT(A1,"00\:00\:00.000")
format A3 as [h]:mm:ss.000 to get 0:00:13.625 for your example
Assumes times are on the same "day", if you need to pass midnight you can revise formula to
=MOD(TEXT(A2,"00\:00\:00.000")-TEXT(A1,"00\:00\:00.000"),1)
You need to use the MID function to grab each section of the time, like this:
=MID(A1,1,2)&":"&MID(A1,3,2)&":"&MID(A1,5,2)&"."&MID(A1,8,3)
This will change 113137.644 to 11:31:37.644.
You can then do the math on it like this (all in one cell, but broken up here for readability):
=TEXT(MID(B1,1,2)&":"&MID(B1,3,2)&":"&MID(B1,5,2)&"."&MID(B1,8,3), "hh:mm:ss.000")
-
TEXT(MID(A1,1,2)&":"&MID(A1,3,2)&":"&MID(A1,5,2)&"."&MID(A1,8,3),"hh:mm:ss.000")
That should give you 0.000157697. Change the field's custom format to hh:mm:ss.000 to give you 00:00:13.625.
You can use this formula to convert your values to time
=(LEFT(A1,2)+(MID(A1,3,2)+RIGHT(A1,LEN(A1)-4)/60)/60)/24
You can then subtract and convert back using the following formula
=TEXT(B1,"hhmm")&TEXT(MOD(B1*24*60,1)*60,"00.000")
But it would probably be better for you to actually use proper decimal values in fractions of days or hours rather than this you can't calculate anything with.

Resources