+ Reply to Thread
Results 1 to 17 of 17

Converting a Time Extracted from Data as hh:mm problem

  1. #1
    Registered User
    Join Date
    04-18-2024
    Location
    Scotland
    MS-Off Ver
    MS365 Version 2403
    Posts
    6

    Converting a Time Extracted from Data as hh:mm problem

    Good morning everyone,

    First post here for me, used forum a lot for answers but never came across one i cant see a definitive answer for.

    When i extract data from software used to log time on a site it is pulling as for example 7h 42m and so on, so it has the hour in numbers followed with the H and minutes in numbers followed by M.

    Is there any easy way i can have this just simply changed to hours and minutes so i could total up all the pulled data, it is a weekly timesheet so normally pulling 5 days worth.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,716

    Re: Converting a Time Extracted from Data as hh:mm problem

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.

    Administrative Note:

    Is your forum profile showing the Excel PRODUCT that you need this to work for?

    Members will tailor the solutions they offer to the Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your product is for Mac, please also state this.

    The three most recent Excel products are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the version number in your profile (e.g. MS365 Version 2306). This is in the About Excel section further down the Account page.

    Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,053

    Re: Converting a Time Extracted from Data as hh:mm problem

    Maybe a formula like this with the cell formatted as Time

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

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Converting a Time Extracted from Data as hh:mm problem

    Quote Originally Posted by ByteMarks View Post
    Maybe a formula like this with the cell formatted as Time

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I think there need 1 more space (after the h) in the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,053

    Re: Converting a Time Extracted from Data as hh:mm problem

    Timevalue takes care of it I think.

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

    Re: Converting a Time Extracted from Data as hh:mm problem

    It might also be wise to change the "m" to ":0" in the final substitute, to avoid confusion about h:m and m:s

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    04-18-2024
    Location
    Scotland
    MS-Off Ver
    MS365 Version 2403
    Posts
    6

    Re: Converting a Time Extracted from Data as hh:mm problem

    demo11.xlsx

    attachment added

  8. #8
    Registered User
    Join Date
    04-18-2024
    Location
    Scotland
    MS-Off Ver
    MS365 Version 2403
    Posts
    6

    Re: Converting a Time Extracted from Data as hh:mm problem

    Thankyou have updated profile and now attached an excel sheet (stripped out sensitive info)
    Last edited by AliGW; 04-18-2024 at 05:28 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead.

  9. #9
    Registered User
    Join Date
    04-18-2024
    Location
    Scotland
    MS-Off Ver
    MS365 Version 2403
    Posts
    6

    Re: Converting a Time Extracted from Data as hh:mm problem

    I just really want to capture the time per user and then probably an overall time of them all combined.

    To hopefully just display it as for example 36:13 if it was showing as 1d 12h 13m as an example

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,716

    Re: Converting a Time Extracted from Data as hh:mm problem

    Your profile still doesn't tell us which Excel PRODUCT you are using.

  11. #11
    Registered User
    Join Date
    04-18-2024
    Location
    Scotland
    MS-Off Ver
    MS365 Version 2403
    Posts
    6

    Re: Converting a Time Extracted from Data as hh:mm problem

    i think that is it now, apoligies

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,716

    Re: Converting a Time Extracted from Data as hh:mm problem

    Yes - that's much better - thanks.

    Have you tried the solutions offered? If so, does any of them work for you?

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

    Re: Converting a Time Extracted from Data as hh:mm problem

    Assuming that the times in column I are correct (the first two are out by 1 minute), you can use this formula in N6:

    =IF(COUNTIF(I6,"*d*"),LEFT(I6,FIND("d",I6)-1)+TIMEVALUE(SUBSTITUTE(SUBSTITUTE(MID(I6,4,10),"h",":"),"m",":0")),TIMEVALUE(SUBSTITUTE(SUBSTITUTE(I6,"h",":"),"m",":0")))

    Use a custom format of [h]:mm, and then copy down to the bottom of your data. Note that the final result gives a #VALUE error, because I40 contains a "w". Rather than complicate the formula even more, you can just insert an autosum in that cell.

    Hope this helps.

    Pete

  14. #14
    Registered User
    Join Date
    04-18-2024
    Location
    Scotland
    MS-Off Ver
    MS365 Version 2403
    Posts
    6

    Re: Converting a Time Extracted from Data as hh:mm problem

    thanks for the information now doing what i had hoped for

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,716

    Re: Converting a Time Extracted from Data as hh:mm problem

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  16. #16
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Converting a Time Extracted from Data as hh:mm problem

    I don't understand why you have a text 10h 43m for example.
    It is also possible to calculate this direct by subtracting the start from the stop time and format the time in the desired format.

    You can calculate with the results.

    See examples in attachment.
    Attached Files Attached Files

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

    Re: Converting a Time Extracted from Data as hh:mm problem

    I've just discovered that my formula does not work properly when there are no hours in column I, e.g. I20, I22, or I27. Here, the minutes are shown as hours, although the sub totals remain correct.

    One way to overcome this is to use the time and date values directly, and to use this formula in O6:

    =F6-E6

    Format the cell with a custom format of [h]:mm and copy down. This is how I discovered that many of your time differences are out by 1 minute. There is also no value (0:00) reported for the subtotals, but it is quite easy to insert a SUM() function with appropriate ranges wherever that occurs.

    Hope this helps.

    Pete

+ 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] Matching Extracted Number with an Array of Extracted Numbers
    By markvdhouten in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-12-2021, 06:33 AM
  2. [SOLVED] Converting Extracted report in different format
    By anwitha in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-17-2021, 10:57 AM
  3. [SOLVED] A report to show data extracted from table with time stamp
    By Shamz41 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-22-2018, 07:38 PM
  4. Problem with the extracted data
    By ravik453 in forum Excel General
    Replies: 5
    Last Post: 07-08-2015, 08:03 AM
  5. [SOLVED] Date and time converting and summation problem
    By rsami in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-19-2013, 10:20 AM
  6. [SOLVED] Extracted time from date/time field does not flag on =IF(TIME function.
    By Vlad717 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-09-2013, 03:29 PM
  7. Converting time into decimals...different problem.
    By ctess in forum Excel General
    Replies: 5
    Last Post: 10-09-2007, 07:31 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