+ Reply to Thread
Results 1 to 6 of 6

Duration as text to time

  1. #1
    Registered User
    Join Date
    05-21-2019
    Location
    Glasgow
    MS-Off Ver
    2017
    Posts
    3

    Duration as text to time

    Hi there

    I have data showing as '1d 5h 30m' I wish to display is as dd:hh:mm (01:05:30)
    So far I have managed to use the substitute formula to strip it down to show 1:5:30.

    It seems to work to an extent some other examples include

    8h becomes 8:
    4d 1h becomes 4:1:


    The formula I have used is =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(C9,"d",":")," ",""),"h",":"),"m","")

    Thanks
    Attached Files Attached Files
    Last edited by ctp91; 05-21-2019 at 07:13 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: Duration as text to time

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. 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 shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    05-21-2019
    Location
    Glasgow
    MS-Off Ver
    2017
    Posts
    3

    Re: Duration as text to time

    have done

  4. #4
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Duration as text to time

    that are many variations to take into account, so it is a longer formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    the outcome of this formula is a number that can be formatted as day and hours format
    also the cell format is changed to dd:hh:mm so days are also shown in time like format.


    see attachment for details
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-21-2019
    Location
    Glasgow
    MS-Off Ver
    2017
    Posts
    3

    Re: Duration as text to time

    Hey! this works for some of the cells, however when it comes to 8h or 5m it displays the duration as 00:00:00

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,531

    Re: Duration as text to time

    Try: =SUMPRODUCT(VALUE(IFERROR(MID(0&A16,SEARCH({"d","h","m"},0&A16)-2,2),{0,0,0})),{1440,60,1})/1440
    Remember to format the cells dd:hh:mm
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. time formats and time duration formula
    By kristinGersh in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-30-2018, 03:17 PM
  2. Replies: 5
    Last Post: 09-29-2016, 09:58 PM
  3. Replies: 2
    Last Post: 07-14-2015, 02:12 PM
  4. Displaying data as time duration rather than time of day
    By BrookeA in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-13-2014, 06:48 PM
  5. [SOLVED] How to create a real time report with on/off time and duration?
    By Why123 in forum Excel General
    Replies: 7
    Last Post: 11-21-2013, 02:01 AM
  6. [SOLVED] Split Time Duration to first complete the running hour and then go to End time
    By joogibabu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-06-2013, 10:56 PM
  7. Calculate finish time given start time, working hours and job duration
    By swanseaexcel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-23-2012, 03:00 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