+ Reply to Thread
Results 1 to 6 of 6

Need Help to convert a string containing Day, Hour, Mins, Seconds to Minutes

  1. #1
    Registered User
    Join Date
    11-27-2013
    Location
    SG
    MS-Off Ver
    Excel 2010
    Posts
    10

    Need Help to convert a string containing Day, Hour, Mins, Seconds to Minutes

    Hi there

    I have an excel sheet that contain time duration values of days hours minutes seconds as follows on Column A
    Note that some of the values just indicates hours minutes and seconds

    2 03:32:37 - Need this to be converted to minutes in Column B = 3093
    00:00:00 - This needs to display in Column B = 0
    00:56:24 - This needs to display in Column B = 56
    16:50:17 - This needs to display in Column B = 65

    I tried the following:

    In Column C:
    =LEFT(A1,FIND(" ",A1)-1)*1440

    In Column D:
    =RIGHT(A1,LEN(A1)-SEARCH(" ",A1))*60*24

    In Column B:
    =C1+D1

    I managed to convert the value 2 03:32:37 as in 2 (days) 03 (hours) 32 (mins) 37 (secs) to 3093 - which is the value that I want in minutes.

    However, when i applied this formula to the rest of the rows, it just shows #VALUE instead of the correct values.

    Is there any formula that can help solve my issue?

    Edit:

    Example3.xlsx attached as sample. There is a "Before" Sheet and "After" Sheet indicating what I've done (and failed) and what I want to achieve.
    The formulas I used above is in "After" sheet.

    Thanks alot in advance!
    Attached Files Attached Files
    Last edited by aSquared; 12-31-2013 at 01:26 AM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Need Help to convert a string containing Day, Hour, Mins, Seconds to Minutes

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Need Help to convert a string containing Day, Hour, Mins, Seconds to Minutes

    Hi and welcome ot the forum

    Not sure how you arrive at 65 for the last example?

    Try this...
    =HOUR(A4)*60+MINUTE(A4)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Need Help to convert a string containing Day, Hour, Mins, Seconds to Minutes

    hi aSquared. try this in B2 & copy down:
    =IFERROR(LEFT(A2,FIND(" ",A2))+MID(A2,FIND(" ",A2)+1,8),A2)*1440
    or:
    =IFERROR(LEFT(A2,FIND(" ",A2))+RIGHT(A2,8),A2)*1440

    like what Ford mentioned, i think row 5 should be 1010.

    and if you need to round, then:
    =ROUND(IFERROR(LEFT(A2,FIND(" ",A2))+MID(A2,FIND(" ",A2)+1,8),A2)*1440,0)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Registered User
    Join Date
    11-27-2013
    Location
    SG
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need Help to convert a string containing Day, Hour, Mins, Seconds to Minutes

    Hi benishiryo

    Thank you very much for the formula. It worked perfectly!

    I actually need to convert hundreds of those to minutes format. Really appreciate it alot.

    And yes, row 5 was a typo error. it should be 1010. Thanks for pointing it our Ford!

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Need Help to convert a string containing Day, Hour, Mins, Seconds to Minutes

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. convert days hours minutes seconds to just minutes
    By hollylynn in forum Excel General
    Replies: 4
    Last Post: 08-28-2015, 08:53 AM
  2. Convert Days:Hours:Minutes:seconds to minutes.
    By Kevingardner1 in forum Excel General
    Replies: 4
    Last Post: 06-03-2014, 06:44 PM
  3. Minutes and seconds to Hours mins secs
    By bazwillrun in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 11-25-2013, 03:19 PM
  4. convert from seconds to form hours: minutes: seconds?
    By nguyen_han in forum Excel General
    Replies: 2
    Last Post: 10-13-2011, 06:56 AM
  5. Convert mins:secs to seconds only
    By ronedwards in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-03-2005, 07:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1