+ Reply to Thread
Results 1 to 7 of 7

Convert text Days, hours, minutes to total hours.

  1. #1
    Registered User
    Join Date
    01-21-2018
    Location
    Northampton, England
    MS-Off Ver
    2010
    Posts
    61

    Convert text Days, hours, minutes to total hours.

    Afternoon all,

    Im looking for help with the below image. I'm trying to convert this data from its current format, to total hours rounded up to the nearest full hour.

    Capture.PNG

    Example document also included.
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,221

    Re: Convert text Days, hours, minutes to total hours.

    Please try at F5

    =ROUNDUP(SUMPRODUCT(TEXT(MID("00"&SUBSTITUTE(B5,",",", "),FIND({"d","h","m"},"00"&SUBSTITUTE(B5,",",", ")&"dhm")-4,3),"0;;;\0")/{1,24,1440})*24,0)
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,112

    Re: Convert text Days, hours, minutes to total hours.

    In E5, enter

    =IFERROR(TRIM(LEFT([@[Time in location]],FIND("day",[@[Time in location]])-1))*24,0)+IFERROR(VALUE(TRIM(MID([@[Time in location]],FIND("hour",[@[Time in location]])-3,3))),IFERROR(VALUE(TRIM(LEFT([@[Time in location]],FIND("hour",[@[Time in location]])-1))),0))+IF(ISERROR(FIND(" 0 minute",[@[Time in location]])),1,0)

    I wasn't sure if you would ever have minutes not included, or tagged as 0 minute(s) - I thought it would be 0 minutes, but if there are no minutes included when there are full hours, just change

    +IF(ISERROR(FIND(" 0 minute",[@[Time in location]])),1,0)


    to

    +IF(ISERROR(FIND("minute",[@[Time in location]])),0,1)
    Bernie Deitrick
    Excel MVP 2000-2010

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,112

    Re: Convert text Days, hours, minutes to total hours.

    That is a very clever solution!

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2409
    Posts
    13,549

    Re: Convert text Days, hours, minutes to total hours.

    I agree with Bernie.

    I will have to study that one for a while. It goes in my "to keep file".
    Dave

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,221

    Re: Convert text Days, hours, minutes to total hours.

    Bernie and Dave, Thank you.

    Here another version of the formula

    =SUM(TEXT(MID(0&A5,SEARCH({"d","h","m","se"},0&A5&"dhmise")-3,2),"0;;;\0")*{1,"1:0","0:1","0:0:1"})

    19.jpg

    https://www.facebook.com/XcWizard/po...60604607341301
    Last edited by Bo_Ry; 04-02-2021 at 03:18 PM.

  7. #7
    Registered User
    Join Date
    01-21-2018
    Location
    Northampton, England
    MS-Off Ver
    2010
    Posts
    61

    Re: Convert text Days, hours, minutes to total hours.

    Amazing thanks all

+ 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. [SOLVED] Breakdown total shift hours into days/hours/minutes
    By exceleratevba in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-01-2020, 04:52 PM
  2. Convert x Days y Hours z Minutes to Minutes
    By andyrwise in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-03-2019, 12:56 PM
  3. convert days hours minutes seconds to just minutes
    By hollylynn in forum Excel General
    Replies: 4
    Last Post: 08-28-2015, 08:53 AM
  4. Convert Days:Hours:Minutes:seconds to minutes.
    By Kevingardner1 in forum Excel General
    Replies: 4
    Last Post: 06-03-2014, 06:44 PM
  5. [SOLVED] Function or macro to convert string with weeks, days, hours, minutes to Hours
    By kknb0800 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2012, 11:35 AM
  6. Convert days -> Years, Months, Days, Hours, Minutes, Seconds
    By brharrii in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-06-2012, 06:44 PM
  7. Convert [H] to days, hours, minutes
    By ConanLloyd in forum Excel General
    Replies: 5
    Last Post: 12-16-2010, 03:19 PM

Tags for this Thread

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