formatting only in minutes in excel cell - excel

I am using excel 2007.I need help in formating cells to display only minutes.
Suppose if the actual duration is 30 seconds,it should show .5

The simplest way to do this is to multiply your time value by 1440 (the number of minutes in a day), so if A1 contains 5:20 then use this formula in B1 to get 320
=A1*1440
This solution will work for any time value, even values over 24 hours, e.g. converts 33:20 to 2000
Edit: I note you mention "formatting" - you could custom format A1 as [m] (you need to include the square brackets) which would also display 320 or 2000 in my examples without need for a formula in another cell.......but that will only display an integer so you can't use that to get 0.5 for 30 seconds

=(HOUR(A1))*60+MINUTE(A1)+ IF(SECOND(A1)>30, INT(1+ SECOND(A1)/60), SECOND(A1)/60)

Related

Time Study in Excel

I am completing a time study and recording time in excel. I have numbers like 2.24, etc.. I am trying to add them and average them and I am getting numbers like 9.76 when I really want 10m and 16seconds. Any thoughts to fixing this?
When I change the format to mm:ss it give me wild answers
If 9.76 is a decimal number and it's is in A1, then in B1 you can use:
=((A1-(ROUNDOWN(A1;0)))/0,6+(ROUNDOWN(A1;0)))/24
Also, format of cell with formula must be hours (I've used [hh]:mm:ss)
Applying this, I get:
I've done it in the following way: I used cell formatting, like u:mm:ss (in English locale, this might be h:mm:ss instead).
In one cell, I've put 0:2:24 (zero hours, two minutes, 24 seconds).
In the cell below, I've put 0:7:52.
Adding both cells (inside a cell with the mentioned cell formatting) yielded 0:10:16.
=9.76 value(minutes)
=24*60 number of minutes in a day
=A1/A2 formatted as time
Will show 12:09:46. You can use =MINUTE(A3) to extract the minutes and =SECOND(A3) for the seconds.
Actually if 9.76 means 9 minutes and 76 seconds, you'll need more formulas to extract the minutes and seconds then add them together. You can use =Floor() to get the integer. Subtract to find the .76 and multiply by 100 to get the number of seconds. Then divide by 60 to convert to minutes and add to the 9 whole mins. Now you have the number of mins which you can convert to a time value per the above.
EDIT:
You need to enter in Excel as 0:02:12 then you can add quite nicely. If you don't want to re-enter everything you can do this: =VALUE("0:"&SUBSTITUTE(A1,".",":")) then add. Be sure to convert each individual value BEFORE adding otherwise you might get incorrect results.

Subtracting seconds in Excel

I'm trying to subtract start time from end time to get duration, ie:
1:02 - 0:10 = 0:52
But what I'm getting is:
0:92
I'm using the 0\:00 format. Other suggested formats, such as [mm]:ss, are turning my data into numbers that I don't undestand, ie 1:02 becomes 146880:00
I just want to quickly enter a bunch of times, subtract one col from the other and be done with it.
Does anyone know a way to do that?
Solutions follow an explanation of the results showing in the question.
The format 0\:00 is really the format 000 with a colon character inserted between the first and second digits.
If a cell holds the value 102 and has a format of 0:\00 it will show as 1:02 in the worksheet but behind the scenes its value is still 102. So
1:02 - 0:10 = 102 - 10 = 92 = 0:92 in 0\:00 format
To understand the result with the [mm]:ss format, you need to understand how dates (and time) values are represented in Excel. There is a reasonable explanation on this webpage from Chip Pearson
First, as a date/time value 102 is equivalent to 0:00 on 11 April, 1900 as it is 102 days from Excel's day/time zero. Second, the format [mm]:ss expresses this elapsed time in minutes and seconds. So
102 days = 102*24*60 minutes = 146880 minutes
which gets displayed as 146880:00 in [mm]:ss format
There are a couple of ways you might resolve your problem.
The first involves entering data differently. A time can be entered directly into the worksheet as hours:minutes:seconds. So 1 minute and 2 seconds can be entered as 0:1:2 (or 00:01:02 or any variant such as 0:01:2 or 00:1:02). This is probably less convenient than just entering 102. By default, numbers entered in this way will display in a hh:mm:ss format but you can suppress the display of hours by changing the format to mm:ss or [mm]:ss. The latter should be used if any of your time values are 60 minutes or more since, the former will suppress the display of hours - for example, entering 0:61:2 (61 minutes and 2 seconds) displays as 01:02 with the former but as 61:02 with the latter.
Note that if you just enter 1:2 rather than 0:1:2 Excel interprets this as 1 hour, 2 minutes and 0 seconds and will display as 02:00 using format mm:ss or as 62:00 using [mm]:ss.
The second way allows you to enter the data as before using the 0\:00 format but requires the use of formulae to convert your entered value into seconds - so, for example, an entered value of 102 is intended to represent 1 minute and 2 seconds, gets correctly displayed as 1:02 but is converted behind the scenes to 62 seconds.
If A1 and B1 contain the entered values the then formula for A1 less B1 is
=(INT(A1/100)*60+A1 - 100*INT(A1/100))-(INT(B1/100)*60+B1 - 100*INT(B1/100))
This formula calculates its result as a number of seconds.
If this result is placed in cell C1 then the formula
=100*INT(C1/60)+(C1-60*INT(C1/60))
converts C1 to a result suitable for displaying with the 0:\00 format
Alternatively, the result in seconds can be converted to days by dividing by 24*60*60 = 86400 and displayed using a time format such as [mm]:ss

Convert a cell with 1:04 (mm:ss), to 64 (mm)

I am trying to take a cell in Excel that includes a summarized value e.g. 00:30 + 00:34 = 1:04, and I would like it to show in another cell as 64 (minutes).
How do I do this? I have been trying to use the CONVERT command, but have not yet succeeded.
Any thoughts?
You can change the format of the cell from mm:ss to [m]:ss (or just [m] if you don't want to display seconds).
This will make minutes overflow over 60, without displaying as hours:mins.
You are on the right track with "convert". But keep in mind that you will need to address each 'element' of your end product separately - that is, the hours & the minutes in your original cell. Assuming your data is in A1 in the Time format, use the following:
=CONVERT(HOUR(A1),"hr","mn")+MINUTE(A1)
This takes the number of hours present in A1, converts those to minutes, and adds the minutes already present.

formula works fine with the cell in hh:mm:ss format, but the same formula gives incorrect value in cell with mm:ss format

my data appears as this
WAIT
29:45:00
2:41:14
46:06:00 ' <---
0:25
19:23 ' <---
2:25:12
37:36:00
2:12:24
1:34:35
1:54:13
13:00:53
when i am applying the formula =HOUR(F7)*3600+MINUTE(F7)*60+SECOND(F7) to 46:06:00, it gives the correct answer, however when same formula is applied to the 19:23, excel recognizes 19:23 in HHMMSS format, however it is MMSS...
i have a huge data base and it would be very difficult for me to change it manually....
please help...
By default, Excel treats numbers in the format xx:xx or x:xx as h:mm, and NEVER as mm:ss.
I don't see a way to transform the values into valid hh:mm:ss, since there is no handle for Excel to determine which number is lacking the hour part.
The best option is to change the routine that writes the data and have the hour entered as 00: before a mm:ss value.
As long as the data column is formatted as text, you could test how many colons exist in the string and apply a different calculation depending on whether there is 1 or 2. If there is only 1 colon, then use what Excel thinks is the hours as the minutes, and what Excel thinks are the minutes as the seconds.
=IF(LEN(F7)-LEN(SUBSTITUTE(F7,":",""))=2,HOUR(F7)*3600+MINUTE(F7)*60+SECOND(F7),HOUR(F7)*60+MINUTE(F7))
It's difficult to tell whether your data is text-formatted or not - HOUR/MINUTE/SECOND functions work just as well on text-formatted times as real times. What result do you get with this formula?
=ISNUMBER(F7)
If that gives you FALSE then your "times" are text formatted in which case this formula will give you the total seconds:
=LOOKUP(999,({"","0:"}&F7)+0)*86400
format result cell as general
That will interpret 19:23 as 19 minutes 23 seconds as required. For 46:06:00 you will get the result 165960, the total seconds in 46 hours and 6 minutes. Your formula is giving you just the seconds from the remainder after multiples of 24 hours are removed, as pnuts points out. That's because
=HOUR("46:06:00")=22
If you want the result to be 79560 then you can add a MOD function like this:
=MOD(LOOKUP(999,({"","0:"}&F7)+0),1)*86400
The LOOKUP function works here because it exploits the fact that concatenating "0:" to the start of 19:23 (and then doing a calculation like +0) converts 19:23 (19 hours 23 minutes) to 0:19:23 (zero hours, 19 minutes, 23 seconds) but concatenating 0: to 46:06:00 and then adding 0 gives you an error.
Guyz, thx for answering the question..
here is what i tried-
first i applied
=TEXT(D2,"hh:mm:ss") formula to the cell value and then used =IFERROR(SUMPRODUCT(("00:"&d2)+0),d2), so 19:23 got changed to 00:19:23..
It worked though i had to do some manual work on the data...

Excel 2007: How to display mm:ss format not as a DateTime (e.g. 73:07)?

I need to create and Excel table that computes daily training times. each row has the following fields: Date, Distance, Time and Minutes/Km. My main problem is that I want to display the Time in format of mm:ss. For example: 24 min and 3 sec should be 24:03, but "Excel" turns it to 00:03:00 (3 min after midnight). I've tried setting up "special formatting" but still "Excel insists" on formatting the hours. More over, training may exceed 60 minutes and I still want it only as mm:ss
My second question is after I'm done with the formatting issue, what is the simple way to compute Time/Distance?
enter the values as 0:mm:ss and format as [m]:ss
as this is now in the mins & seconds, simple arithmetic will allow you to calculate your statistics
Excel shows 24:03 as 3 minutes when you format it as time, because 24:03 is the same as 12:03 AM (in military time).
Use General Format to Add Times
Instead of trying to format as Time, use the General Format and the following formula:
=number of minutes + (number of seconds / 60)
Ex: for 24 minutes and 3 seconds:
=24+3/60
This will give you a value of 24.05.
Do this for each time period. Let's say you enter this formula in cells A1 and A2. Then, to get the total sum of elapsed time, use this formula in cell A3:
=INT(A1+A2)+MOD(A1+A2,1)
Convert back to minutes and seconds
If you put =24+3/60 into each cell, you will have a value of 48.1 in cell A3.
Now you need to convert this back to minutes and seconds. Use the following formula in cell A4:
=MOD(A3,1)*60
This takes the decimal portion and multiples it by 60. Remember, we divided by 60 in the beginning, so to convert it back to seconds we need to multiply.
You could have also done this separately, i.e. in cell A3 use this formula:
=INT(A1+A2)
and this formula in cell A4:
=MOD(A1+A2,1)*60
Here's a screenshot showing the final formulas:
To make life easier when entering multiple dates/times it is possible to use a custom format to remove the need to enter the colon, and the leading "hour" 0. This however requires a second field for the numerical date to be stored, as the displayed date from the custom format is in base 10.
Displaying a number as a time (no need to enter colons, but no time conversion)
For displaying the times on the sheet, and for entering them without having to type the colon set the cell format to custom and use:
0/:00
Then enter your time. For example, if you wanted to enter 62:30, then you would simply type 6230 and your custom format would visually insert a colon 2 decimal points from the right.
If you only need to display the times, stop here.
Converting number to time
If you need to be able to calculate with the times, you will need to convert them from base 10 into the time format.
This can be done with the following formula (change A2 to the relevant cell reference):
=TIME(0,TRUNC(A2/100),MOD(A2,100))
=TIME starts the number to time conversion
We don't need hours, so enter 0, at the beginning of the formula, as the format is always hh,mm,ss (to display hours and minutes instead of minutes and seconds, place the 0 at the end of the formula).
For the minutes, TRUNC(A2/100), discards the rightmost 2 digits.
For the seconds, MOD(A2,100) keeps the rightmost 2 digits and discards everything to the left.
The above formula was found and adapted from this article:
PC Mag.com - Easy Date and Time Entry in Excel
Alternatively, you could skip the 0/:00 custom formatting, and just enter your time in a cell to be referenced of the edge of the visible workspace or on another sheet as you would for the custom formatting (ie: 6230 for 62:30)
Then change the display format of the cells with the formula to [m]:ss as #Sean Chessire suggested.
Here is a screen shot to show what I mean.
If you are using hand inputted data, you can enter your data as mm:ss,0 or mm:ss.0 depending on your language/region selection instead of 00:mm:ss.
You need to specify your cell format as [m]:ss if you like to see all minutes seconds format instead of hours minutes seconds format.
as text:
=CONCATENATE(TEXT(cell;"d");" days ";TEXT(cell;"t");" hours ";MID(TEXT(cell;"hh:mm:ss");4;2);" minutes ";TEXT(cell;"s");" seconds")
5.In the Format Cells box, click Custom in the Category list.
6.In the Type box, at the top of the list of formats, type [h]:mm;# and then click OK. (That’s a colon after [h], and a semicolon after mm.)
YOu can then add hours. The format will be in the Type list the next time you need it.
From MS, works well.
http://office.microsoft.com/en-us/excel-help/add-or-subtract-time-HA102809662.aspx
One convenient trick to entering elapsed times into Excel is to have two zeros and a colon before the number of minutes, details follow. For copy and paste operations into Excel without have to worry about formatting at all one can use the format 00:XX:XX where XX are two digits totaling < 60. In that case, Excel will echo 0:XX:XX in the cell contents displayed and store the data as 12:XX:XX AM. If one pastes data in a 00:XXX:XX format into Excel, or 00:XX:XX where either XX > 59 this will be converted into a fraction of a day.
For example, 00:121:12 becomes 0.0841666666666667, which if multiplied by the number of seconds in a day, 86,400, becomes 7272 s. Next, 00:21:12 would by default show 0:21:12 stored as 12:21:12 AM. Finally, 00:21:60 becomes 0.0152777777777778, also a fraction of a day.
This suggestion is made merely to avoid having to worry about specific formatting in Excel, and letting the program worry about it. Note, for Excel data internally formatted as 12:XX:XX AM one can only use certain Excel commands, for example, one can take an average. However, subtraction will only work when the result is a positive number. Such that converting times into seconds, fractions of a day, or other real number is suggested for access to more complete arithmetic operation coverage.
For example, if one has a column of mixed time formats, or times that are negative and will not display, if one changes the number formatting to General, all the times will be converted to fractions of a day.

Resources