+ Reply to Thread
Results 1 to 12 of 12

Converting H:MM format to Minutes

  1. #1
    Registered User
    Join Date
    04-24-2020
    Location
    U.S.A.
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2302 Build 16.0.16130.20684) 64-bit
    Posts
    22

    Converting H:MM format to Minutes

    Hello!

    I have a raw report that outputs time in h:mm format. For Example 1h46m. How do I convert this to minutes? I did get this to work by creating a cheat column and using the Text to Column feature and multiplying the hours by 60, then another column and added both minutes and minutes for a sum. Is there an easier way or formula to accomplish this?

    JonnyP47.

  2. #2
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    536

    Re: Converting H:MM format to Minutes

    Try.
    Please Login or Register  to view this content.
    Best Regards,
    Maras.

  3. #3
    Registered User
    Join Date
    04-24-2020
    Location
    U.S.A.
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2302 Build 16.0.16130.20684) 64-bit
    Posts
    22

    Re: Converting H:MM format to Minutes

    The formula did work, but it in the example of 1h 09m the formula calculated 60. I don't feel like it didn't account for the m.
    Another example of 1h 53m it calculated 64.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,445

    Re: Converting H:MM format to Minutes

    How well did you understand how maras_mak's formula works? These "failed" examples appear to have a space in between the hour and minute values, which was not indicated in the OP, and maras_mak's formula did not account for the possible presence of these spaces. Before I make any recommendation, I would wonder if there are any other variations possible. This is bacially a "extract numbers from a text string" kind of problem, and I would want to make sure we know all of the possible text variations in order to get a robust formula.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    04-24-2020
    Location
    U.S.A.
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2302 Build 16.0.16130.20684) 64-bit
    Posts
    22

    Re: Converting H:MM format to Minutes

    My apologies. My level of excel is basic and as a result I did not have a fully understanding of his formula. I am here to learn and glean the knowledge from other users.
    I have attached a sample data set to illustrate.
    Attached Files Attached Files

  6. #6
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Converting H:MM format to Minutes

    =IFERROR(60*LEFT(D2,FIND("h",D2)-1)+MID(D2,FIND("h",D2)+1,2),LOOKUP(9^9,LEFT(D2,{1,2,3})+0)*IF(ISERROR(SEARCH("h",D2)),1,60))
    HTML Code: 
    try above formula
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  7. #7
    Registered User
    Join Date
    04-24-2020
    Location
    U.S.A.
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2302 Build 16.0.16130.20684) 64-bit
    Posts
    22

    Re: Converting H:MM format to Minutes

    Thank you so much. Here are the results. It appears that the last digit if the minutes are two numbers, only calculating first number. This is very exciting!
    1h 11m 61
    45m 45
    2h 04m 120
    2h 16m 121
    2h 18m 121
    7m 7
    1h 16m 61
    51m 51

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Converting H:MM format to Minutes

    sorry try
    Please Login or Register  to view this content.
    I think that it is not working where there is only H or Only M
    Last edited by samba_ravi; 05-14-2020 at 08:35 PM.

  9. #9
    Registered User
    Join Date
    04-24-2020
    Location
    U.S.A.
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2302 Build 16.0.16130.20684) 64-bit
    Posts
    22

    Re: Converting H:MM format to Minutes

    That is INCREDIBLE. That worked! What is the best way to learn these formulas samba_ravi?

  10. #10
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Converting H:MM format to Minutes

    or can try
    =SUBSTITUTE(IF(COUNTIF(D2,"*h*")=0,"0:","")&SUBSTITUTE(SUBSTITUTE(D2,"h",":"),"m","")&IF(COUNTIF(D2,"*m*")=0,"00","")," ","")*60*24

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

    Re: Converting H:MM format to Minutes

    Another one
    F2
    =SUMPRODUCT(MID(0&D2&"00h00m",FIND({"h","m"},0&D2&"00h00m")-2,2)*{60,1})

  12. #12
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: Converting H:MM format to Minutes

    Please Login or Register  to view this content.

+ 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 total minutes into hour and minutes in a single corresponding cell
    By paradise2sr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-16-2017, 02:44 AM
  2. [SOLVED] Converting Standard Time format (hh:mm:ss) to number of minutes
    By xygrax in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-27-2014, 10:54 AM
  3. [SOLVED] Converting Minutes Format back to Decimals
    By DawsonG in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-05-2013, 03:23 PM
  4. RE: Converting decimal minutes to hours, minutes and seconds
    By mills49 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-14-2013, 09:14 AM
  5. Converting time to minutes, original format 1:30:00
    By jeans in forum Excel General
    Replies: 3
    Last Post: 03-18-2011, 03:46 PM
  6. Converting hours and minutes in military time to minutes
    By Argile79 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-13-2010, 02:42 PM
  7. converting Days Hours & minutes into just minutes in excel
    By Six Sigma Blackbelt in forum Excel General
    Replies: 5
    Last Post: 04-28-2006, 04:45 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