Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minutes to seconds
Hi, I'm facing a little problem and I have no idea how to solve this, so I hope some of you guys can help me out on this. I'd like to see a time of for instance 6:08.74 (6 minutes, 8 seconds and 74 hundreds) to be calculated as a value of 368.74 seconds. So let's say C10 says 6:08.74 then I'd like to have a formula in C11 which tells me that it's the same as 368.74 seconds. Hope you guys can help me out, thanks is advance Partysquad. -- Partysquad ------------------------------------------------------------------------ Partysquad's Profile: http://www.excelforum.com/member.php...o&userid=28970 View this thread: http://www.excelforum.com/showthread...hreadid=487040 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minutes to seconds
See response in .newusers
-- HTH RP (remove nothere from the email address if mailing direct) "Partysquad" wrote in message ... Hi, I'm facing a little problem and I have no idea how to solve this, so I hope some of you guys can help me out on this. I'd like to see a time of for instance 6:08.74 (6 minutes, 8 seconds and 74 hundreds) to be calculated as a value of 368.74 seconds. So let's say C10 says 6:08.74 then I'd like to have a formula in C11 which tells me that it's the same as 368.74 seconds. Hope you guys can help me out, thanks is advance Partysquad. -- Partysquad ------------------------------------------------------------------------ Partysquad's Profile: http://www.excelforum.com/member.php...o&userid=28970 View this thread: http://www.excelforum.com/showthread...hreadid=487040 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minutes to seconds
try this formula "=c11*60*60*24" and make sure to format the cell as a
number |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minutes to seconds
Hello Partysquad, Add a VBA module to your project. Copy the following code into it. On the worksheet use it like any other formula. Example: Cell C10 = "6:08.74" Cell C11 =TotalSeconds(C10) Code: -------------------- Public Function TotalSeconds(Cell As Range) Application.Volatile Dim I As Long Dim TimeStr As String Dim X TimeStr = Cell.Value I = InStr(1, TimeStr, ":") If I 0 Then X = Val(Left(TimeStr, I - 1)) * 60 X = X + Val(Right(TimeStr, Len(TimeStr) - I)) Else X = 0 End If TotalSeconds = X End Function -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=487040 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minutes to seconds
The formula you want is =C10*24*60*60 formatted as general. Why?
Times are really numbers where 1.0 is actually a day. Multiply by 24 to get hours, then by 60 to get minutes, then by 60 again to get seconds. -- Gary's Student "Partysquad" wrote: Hi, I'm facing a little problem and I have no idea how to solve this, so I hope some of you guys can help me out on this. I'd like to see a time of for instance 6:08.74 (6 minutes, 8 seconds and 74 hundreds) to be calculated as a value of 368.74 seconds. So let's say C10 says 6:08.74 then I'd like to have a formula in C11 which tells me that it's the same as 368.74 seconds. Hope you guys can help me out, thanks is advance Partysquad. -- Partysquad ------------------------------------------------------------------------ Partysquad's Profile: http://www.excelforum.com/member.php...o&userid=28970 View this thread: http://www.excelforum.com/showthread...hreadid=487040 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minutes to seconds
If 6:08.74 was in c10, I could use:
=c10*24*60*60 Format the cell as General. Partysquad wrote: Hi, I'm facing a little problem and I have no idea how to solve this, so I hope some of you guys can help me out on this. I'd like to see a time of for instance 6:08.74 (6 minutes, 8 seconds and 74 hundreds) to be calculated as a value of 368.74 seconds. So let's say C10 says 6:08.74 then I'd like to have a formula in C11 which tells me that it's the same as 368.74 seconds. Hope you guys can help me out, thanks is advance Partysquad. -- Partysquad ------------------------------------------------------------------------ Partysquad's Profile: http://www.excelforum.com/member.php...o&userid=28970 View this thread: http://www.excelforum.com/showthread...hreadid=487040 -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minutes to seconds
Bob and Andrew, thanks for replying, I've added the formula into my sheet, and I've format both cells (the one with the minutes and the one with the formula) as a number, but all I get as a result is #VALUE! Leith, I think I'm too much of a newbie in Excel to understand what you're talking about, sorry for that, but I appreciate your reply. -- Partysquad ------------------------------------------------------------------------ Partysquad's Profile: http://www.excelforum.com/member.php...o&userid=28970 View this thread: http://www.excelforum.com/showthread...hreadid=487040 |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minutes to seconds
Also when I have one or both of the cells formatted as General it stil gives me #VALUE -- Partysqua ----------------------------------------------------------------------- Partysquad's Profile: http://www.excelforum.com/member.php...fo&userid=2897 View this thread: http://www.excelforum.com/showthread.php?threadid=48704 |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minutes to seconds
Hello Partysquad, Here's how to install the macro. Don't panic, it's not difficult. ______________________________________________ 1) First Copy the code by selecting it and press CTRL + C. 2) Have your workbook open and press ALT + F11 to open the Visual Basic Editor. 3) Press ALT + I, this will display the Insert Menu. 4) Press M to insert a new VBA module into your project (workbook). 5) Press CTRL + V to paste the code into the module 6) Press CTRL + S to save the macro. 7) Press ALT + Q to return to Excel ______________________________________________ Your done. The macro is installed and you can call use it as I showed you in the previous post. Code: -------------------- -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=487040 |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minutes to seconds
Leith, You're a genious, thanks for the support, couldn't have done this without your help. It's working perfect now, you don't know how happy you're making me ;) Partysquad -- Partysquad ------------------------------------------------------------------------ Partysquad's Profile: http://www.excelforum.com/member.php...o&userid=28970 View this thread: http://www.excelforum.com/showthread...hreadid=487040 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to convert Minutes:Seconds format to minutes with seconds con | Excel Worksheet Functions | |||
How do I change a minutes and seconds as a 2400 time to seconds? | Excel Worksheet Functions | |||
Entering Seconds but displaying minutes & seconds | Excel Discussion (Misc queries) | |||
Formula to Change Hours:Minutes:Seconds to Seconds only | Excel Discussion (Misc queries) | |||
Convert "Time Interval" in "hours : minutes : seconds" to seconds | New Users to Excel |