+ Reply to Thread
Results 1 to 8 of 8

Remove "h" and "n" from time value

  1. #1
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Remove "h" and "n" from time value

    I am trying to convert a time value e.g. 508h 30.0n into a single decimal value i.e. 508.5. I can strip off the "h" but failing to combine it with the second part. I have attached a sample of what I am trying to achieve.

    Grateful for any assistance.
    Attached Files Attached Files

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,617

    Re: Remove "h" and "n" from time value

    Don't understand, sorry.

    What are you trying to do with this?

    =580+(49.81/60)

    The values in the workbook are all text.
    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 shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Remove "h" and "n" from time value

    May be try in

    I10=(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(I2,"h",""),"n","")," ",REPT(" ",99)),99)+0)+(RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(I2,"h",""),"n","")," ",REPT(" ",99)),99)+0)/60
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,581

    Re: Remove "h" and "n" from time value

    In I9 then copied across

    =0+LEFT(I2,FIND("h",I2)-1)+MID(SUBSTITUTE(I2,"n",""),FIND("h",I2)+1,250)/60
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Remove "h" and "n" from time value

    Please try

    =VALUE(LEFT(I2,FIND("h",I2)-1))+(VALUE(MID(LEFT(I2,LEN(I2)-1),FIND(" ",I2)+1,100))/60)


    Regards.

  6. #6
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Remove "h" and "n" from time value

    Once again, thanks to all. Some thinking that always leaves me amazed.

  7. #7
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Remove "h" and "n" from time value

    do you get and 30h for they would error
    perhaps the below may fix that
    =IFERROR(LEFT(L2,SEARCH("h",L2,1)-1)+MID(L2,SEARCH("h",L2,1)+1,5)/60,LEFT(L2,SEARCH("h",L2,1)-1)*1)

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: Remove "h" and "n" from time value

    No on sheet formula.
    Double click on required cell for in-situ conversion.
    torachan.
    Attached Files Attached Files

+ 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] Brief formula to convert time values to "shift1", "shift2", "shift3".
    By darekpawel in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 04-11-2019, 07:05 AM
  2. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  3. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  4. [SOLVED] VBA help needed to remove all "/" then replace with "-" from cell "B3"and "B5"
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2014, 02:11 PM
  5. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  6. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  7. [SOLVED] Assign Categories for Time of Day: "Morning", "Afternoon", "Evening"
    By long_shanks in forum Excel General
    Replies: 3
    Last Post: 06-11-2013, 02:59 AM

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