+ Reply to Thread
Results 1 to 6 of 6

Converting Text into Hours

  1. #1
    Forum Contributor
    Join Date
    01-28-2013
    Location
    Spencerport, NY
    MS-Off Ver
    Excel 2016
    Posts
    273

    Converting Text into Hours

    Hello all
    I am stuck and looking for some help please
    Attached is the file. You will see in column A that I have a text value that is broken up in Days and Hours and I would like to convert it to hours in column B. I have somewhat of a formula but running into problems whenever the Day is greater than 1 character.....i.e 9 D to 10 D will not calculate incorrectly ( Cell A2 A141 A160 etc)

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,423

    Re: Converting Text into Hours

    Try this in B2:

    =IF(COUNTIF(A2,"*d*"),LEFT(A2,FIND("d",A2)-1),0)*24 + IF(COUNTIF(A2,"*h"),SUBSTITUTE(RIGHT(A2,3),"h","")*1,0)

    then copy down.

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Converting Text into Hours

    I noticed that the ones with minutes are all count as zero so I am ignoring this. But if I were approach to a problem like this, I would create helper columns to extract day and hour values individually in case if I need to go back and modify the formula. See attached.
    Attached Files Attached Files

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Converting Text into Hours

    This should calculate Days, Hours & Minutes

    Enter formula in B2 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by AlKey; 10-18-2019 at 10:43 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Forum Contributor
    Join Date
    01-28-2013
    Location
    Spencerport, NY
    MS-Off Ver
    Excel 2016
    Posts
    273

    Re: Converting Text into Hours

    Thank you Pete !

  6. #6
    Forum Contributor
    Join Date
    01-28-2013
    Location
    Spencerport, NY
    MS-Off Ver
    Excel 2016
    Posts
    273

    Re: Converting Text into Hours

    Thank you ALKey

+ 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] Converting high amount of hours into days, hours, mins
    By SnowBrian in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-05-2018, 07:55 PM
  2. Converting text to time (HH:MM) for calculating hours worked
    By RoKOwen in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-12-2017, 03:58 AM
  3. Converting Total Hours to Business Hours/Days
    By Fadooshy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-27-2015, 12:26 PM
  4. [SOLVED] converting decimal hours to regular time but longer than 24 hours
    By rkruse in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-21-2013, 07:45 PM
  5. [SOLVED] Converting hours and minutes to decimal hours
    By Calandra@Seohan in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-25-2012, 05:25 PM
  6. Converting hours to 8 hour days, 31 day limit? Formula blows up at 256 hours..
    By krfarmer in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-25-2010, 05:21 AM
  7. [SOLVED] Problem converting Hours to Days, Hours, Minutes
    By Zyzzx in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-24-2005, 12:05 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