+ Reply to Thread
Results 1 to 7 of 7

To extract texts from a cell

  1. #1
    Registered User
    Join Date
    04-05-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    80

    To extract texts from a cell

    Dear friends,

    I want to extract texts from a series of data. However I couldn't use Left(), Mid() or Right() due to these data are not in standard format. Is there a more efficient way of doing it other than extracting them manually?

    please see attached.

    Grateful if anyone can help.

    Regards
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: To extract texts from a cell

    This works for all the examples you gave, in B5 copied down

    =IF(AND(CODE(MID(A5,1,1))>=65, CODE(MID(A5,1,1))<=90),MID(A5,1,SEARCH(".",A5)-1),MID(A5,SEARCH(".",A5)+1,SEARCH("^", SUBSTITUTE(A5,".","^",2))-SEARCH(".",A5)-1))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: To extract texts from a cell

    A nice solution, ChemistB.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: To extract texts from a cell

    Thank you Glen.

  5. #5
    Registered User
    Join Date
    04-05-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: To extract texts from a cell

    Hi ChemistB,

    wow, it works. i have no clue what's the formula is, is complicated for me but it's what i was looking for.

    thank you so much.

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

    Re: To extract texts from a cell

    another
    =TRIM(IF(ISNUMBER(LEFT(A5)+0),MID(SUBSTITUTE(A5,".",REPT(" ",25)),20,15),LEFT(SUBSTITUTE(A5,".",REPT(" ",25)),20)))
    "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

  7. #7
    Registered User
    Join Date
    04-05-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: To extract texts from a cell

    Hi Martindwilson,

    Thanks for sharing, it works exactly what i want. Fantastic!

+ 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. Extract texts from a cell and paste it to another cell
    By alterego23 in forum Excel General
    Replies: 3
    Last Post: 11-22-2012, 11:51 PM
  2. Multiple cell texts into one
    By Sorrowsong in forum Excel General
    Replies: 4
    Last Post: 05-31-2012, 02:37 PM
  3. Check to see if a cell contains multiple texts
    By sammythefish in forum Excel General
    Replies: 2
    Last Post: 02-21-2012, 11:25 PM
  4. Compare Texts in Cell
    By captedgar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-29-2010, 12:11 PM
  5. Excel 2007 : How to remove some Texts from Cell ?
    By everfresh1 in forum Excel General
    Replies: 2
    Last Post: 03-06-2009, 10:39 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