• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to convert text hours and minutes to minutes

AV114

Member
How to convert below text hours and minutes to minutes

Time
1 hour 12 mins
1 hour 25 mins
1 hour 10 mins
1 hour 0 mins
1 hour 2 mins
1 hour 9 mins
1 hour 16 mins
1 hour 4 mins
1 hour 11 mins
3 hours 19 mins
1 hour 12 mins
1 hour 6 mins
1 hour 1 min
1 hour 1 min
 

Attachments

  • Book2.xlsx
    8.3 KB · Views: 10
Something like...
=TRIM(LEFT(SUBSTITUTE(A2," ",REPT(" ",99)),99))*60+TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",99)),150,99))*1
 
Or…………..

B2, copied down :

=SUM(TRIM(MID(SUBSTITUTE($A2," ",REPT(" ",50)),{1,99},50))*{60,1})

Regards
Bosco
 
An interesting range of subtle variations! Mine is to use the fact that VALUE() is insensitive to spaces so will serve as an alternative to TRIM(). Also, I use named formulas to break nested formulas into more comprehensible parts. So 'h' and 'm' are defined to refer to
= VALUE( LEFT( Table1[@Time], 2 ) )
= VALUE( MID( Table1[@Time], SEARCH( "min", Table1[@Time] ) - 3, 2 ) )

respectively.

From there a number of options exist. If you want the result as an Excel time duration (decimal part of a day) that is given by
= TIME( h, m, 0 )
By default this would display as 1:25:00 but by using a number format [m] the cell value may be displayed as 85.

If you actually want the cell to contain the 85 as an integer, the cell formula would be
= 60*h + m
or one could multiply the duration by 1440
= 1440 * [@Duration]
 

Attachments

  • Time duration from text (PB).xlsx
    11.3 KB · Views: 5
Back
Top