+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : Extracting alphanumeric strings

  1. #1
    Registered User
    Join Date
    06-01-2012
    Location
    Antartica
    MS-Off Ver
    Excel 2007
    Posts
    3

    Extracting alphanumeric strings

    Hello

    First post around here

    I have to write monthly reports and the software from the data come does not export. I had to copy and paste all the values.

    To make some statistics I have to convert time values furst. Values after paste comes as 7h38m2s, 7 hours, 38 minutes, and 2 second.

    There is problem to extract the number using Extract function because values does not always comes in same order. Some examples I have to deal with

    1d8h0m
    7d7h22m
    20d17h22m
    15h57m16s
    2h37m20s
    14h7m5s

    So on.There no standard dd,hh,mm,ss
    As you can see, there are many values and I have to deal with all. Zero is always ignored and this is the problem to extract function. Because I have to predefine the range of the row to extract but positions changes, and row range sometimes does not work.

    I folloed this http://office.microsoft.com/en-us/ex...001154901.aspx

    How to I extract that values into three cells at least. Hour cell, Minute cell and Second cell.

    Do you know some macro that can help me in conversion?

    Thanks in advance.
    Last edited by Linuxser; 06-05-2012 at 07:41 AM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extracting alphanumeric strings

    one way with formulas
    Attached Files Attached Files
    Last edited by martindwilson; 06-04-2012 at 05:58 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Extracting alphanumeric strings

    Some more formula suggestions

    Table1 extracts days and time using helpers

    Table2 extracts days and time no helpers

    Table3 extracts days, hours, minutes, and seconds
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Registered User
    Join Date
    06-01-2012
    Location
    Antartica
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Extracting alphanumeric strings

    Quote Originally Posted by Marcol View Post
    Some more formula suggestions

    Table1 extracts days and time using helpers

    Table2 extracts days and time no helpers

    Table3 extracts days, hours, minutes, and seconds
    Dear Marcol,

    Simply amazing.
    Thank you.

    Just one small question. To make it work with values as 21m36s should I remove "h"?
    See an example attached if you don't mind.

    time values.xlsx

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Extracting alphanumeric strings

    I don't know how Column C is derived, but it appears it can be used as a helper column.
    In D2
    Please Login or Register  to view this content.
    This adds the missing hour value, and defines "- no reply -", then we can add to the formulae in G2:H2 to handle this new list.

    Another approach (see Sheet2) might be to use Column D to unify the data in Column C to a common "_d_h_m_s" format, then the formulae in F2:I2 become much simpler.
    In D2 (This could be simplified for 2007 and above using IFERROR())
    Please Login or Register  to view this content.
    In both examples I have added conditional formatting to highlight "no replies"
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-01-2012
    Location
    Antartica
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Extracting alphanumeric strings

    Dear Marcol,

    This is so incredible. Save me lots of working hours
    .
    I don't have enough words to say tank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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