+ Reply to Thread
Results 1 to 27 of 27

12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

  1. #1
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Hello

    I need to copy and paste downtime figures for work into Excel convert from Text to Integer so I can add up the totals

    For example

    12h02m23s has been copied from another report to excel I then need to add lots of these figures together so I assume it must be coverted to an integer in the format of hh:mm:ss?

    Any help much appreciated!!

    Thanks

    Jonny

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

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Assuming the example you gave is in A1:

    Copy and paste this formula in B1.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Format accordingly.

  3. #3
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Thank you for the quick reply! I have tried this but it has left it still in text format can I somehow VALUE it?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    -- should convert it into number.

    Try:

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

  5. #5
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    I worked it out I did a colum of

    =VALUE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(D6,"h",""),"m",""),"s",""))

    then next to it

    =VALUE(TEXT(E5,"00\:00\:00"))

    Thank you for the help!

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

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


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  8. #8
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Try this...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  9. #9
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Vikas Thank you that formula has cut out the extra column however it seems to change the larger numbers to something different?

    Example

    TOTAL 38h35m36s 14:35:36

    Why is this?

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

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

  11. #11
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Perfect! Thank you so much

    Jonny

  12. #12
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Sorry zbor but figures are still as text if I use your formula I need vikas formula but able to deal with the high numbers

    Thanks!

    Jonny

  13. #13
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Zbor with your formula this happens

    39m32s 39:32:00

    Any advice?

    Thanks

    Jonny

  14. #14
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Cool Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    I have done the job..
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    check the attached file..
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Vikas

    Thank you again for the help

    This is what I am getting when I open the sheet

    38h35m36s 14:35:36
    35m36s 00:35:36
    38h36s 14:00:36
    38h35m 14:35:00

    I am hoping to get the numbers to be 38 not 14?

    Thanks again

    Jonny

  16. #16
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.
    If posting code please use code tags, see here.

  17. #17
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Cool Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

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

    Check the attached file..
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Thats its Vikas!

    Thank you so much helped me a great deal!

  19. #19
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    I just tried the formula with the full data and I think when it has just 1 figure for the hours instead of too it fails

    38h35m36s 38:35:36
    35m36s 00:35:36
    38h36s 38:00:36
    38h35m 38:35:00
    1h23s23m 00:23:23

    I am sorry I keep stealing your time Vikas but I very much appreciate it

  20. #20
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Non Standardized data entries are the root of all evil in Excel.

    As you've seen, it's extremely difficult to account for all the possible formats that the time can be entered.

    Is it at all possible to standarize how the times are being entered?
    At the very least, make it always include all 3 elements of hours minutes and seconds.
    Even if you have to just type 0h or 0m or 0s

  21. #21
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

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


    Format as [h]:mm:ss

    Edit: attachment
    Attached Files Attached Files
    Last edited by zbor; 10-02-2014 at 04:29 PM.

  22. #22
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    It is insane I have basic Excel knowledge but you guys are on another level!

    I have managed to do it with 2 columns but can't get it down to 1 column

    The manager wants it set up as easy as possible so we just copy and paste the report into a data sheet which then uses vlookups to pull all the data out for graphs and charts for the entire sawmill downtime daily analysis if the single digit hour figure can be cracked I think you guys have done it

    Many thanks

    Jonny

  23. #23
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    OK, so this is a sheet still in the works...
    Not a set of data from somewhere else you're trying to convert.

    Right?

    For simplicity's sake, I suggest designating 3 comlumns.
    1 for entering the hours - A1
    1 for entering the minutes - B1
    1 for entering the seconds - C1

    Then use
    =INT(A1/24)+TIME(A1,B1,C1)

    Still custom format the cell as [hh]:mm:ss

  24. #24
    Registered User
    Join Date
    10-02-2014
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    68

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    My current set up is this for 2 columns

    1st column:

    =VALUE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2,"h",""),"m",""),"s",""))
    This changes 02m23s to 223

    2nd column:

    =VALUE(TEXT(VALUE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(D2,"h",":"),"m",":"),"s","")),"00\:00\:00"))
    This changes 223 to 0:02:23

    and this works in all formats

  25. #25
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Try just little change with Vika's formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click just below left if it helps, Boo?ath?

  26. #26
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Cool Re: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    This is best I can do for this..
    =TRIM(IF(ISERROR(SEARCH("?h",C2)),"00",MID(SUBSTITUTE(C2,"h",REPT(" ",10)),1,10))&":"&IF(ISERROR(SEARCH("?m",C2)),"00",LEFT(RIGHT(SUBSTITUTE(SUBSTITUTE(C2,"h",REPT(" ",10)),"m",REPT(" ",10)),10*2),10))&":"&IF(ISERROR(SEARCH("?s",C2)),"00",(LEFT(RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(C2,"h",REPT(" ",10)),"m",REPT(" ",10)),"s",""),10),10))))*1
    Check the attached file..
    Attached Files Attached Files

  27. #27
    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: 12h02m23s (TEXT) -----> 12:02:23 (INTEGER)

    Try this


    Please Login or Register  to view this content.

    C
    D
    1
    Text Format Custom [hh]:mm:ss
    2
    28h15m36s
    28:15:36
    3
    h35m
    00:35:00
    4
    38h36s
    38:00:36
    5
    3h35m
    03:35:00
    6
    22h32m
    22:32:00
    7
    23h05s
    23:00:05
    8
    18h42m06
    18:42:06
    9
    25s
    00:00:25
    10
    15h
    15:00:00
    11
    h45m
    00:45:00
    Last edited by AlKey; 10-06-2014 at 07:52 AM. Reason: Updated formula
    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

+ 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. Replies: 2
    Last Post: 06-30-2013, 03:30 PM
  2. Replies: 3
    Last Post: 10-27-2011, 05:20 PM
  3. Count the number of occurrences of an integer withing a larger integer
    By nnktran in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2010, 01:04 PM
  4. Convert Text to Integer
    By jerredjohnson in forum Excel General
    Replies: 4
    Last Post: 06-14-2006, 02:45 PM
  5. Extracting an integer from text
    By craig-o in forum Excel General
    Replies: 1
    Last Post: 11-09-2005, 05:10 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