+ Reply to Thread
Results 1 to 10 of 10

Pulling string from a cell

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-15-2015
    Location
    New York
    MS-Off Ver
    Excel 2011 MAC
    Posts
    104

    Pulling string from a cell

    I'm trying to pull certain text out of a cell that's imported in. I'm having a hard time since it's very odd

    A1:
    8:30 PM EDTKC@ NE

    I need to pull out just "KC" It's always going to be right after EDT and either 2 or 3 characters.

    A2:
    10:20 PM EDTLAC@ Denver
    I need "LAC"

    Formula: copy to clipboard
    MID(A1,FIND(" ",A1)+1,256)


    This gives me everything that's after the first space. I'm not sure a better approach. Thank you!

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

    Re: Pulling string from a cell

    Here's one way to do it.

    Formula: copy to clipboard
    =SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(LEFT(A1,FIND("@",A1)-1)," ",REPT(" ",99)),99)),"EDT","")



    A
    B
    1
    8:30 PM EDTKC@ NE
    KC
    2
    10:20 PM EDTLAC@ Denver
    LAC
    Dave

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,745

    Re: Pulling string from a cell

    Although this is simpler.

    Formula: copy to clipboard
    =TRIM(MID(SUBSTITUTE(SUBSTITUTE(A1,"@",REPT(" ",99)),"EDT",REPT(" ",99)),99,99))

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,962

    Re: Pulling string from a cell

    =left(replace(a1,1,find("edt",a1)+2,""),find("@",replace(a1,1,find("edt",a1)+2,""))-1)
    Ben Van Johnson

  5. #5
    Forum Contributor
    Join Date
    01-15-2015
    Location
    New York
    MS-Off Ver
    Excel 2011 MAC
    Posts
    104

    Re: Pulling string from a cell

    @Flameretired
    That did work, the only thing is how can it be adjust so it only take a max of the first 3 letters. I have one that is EDTSEATTLE, and I only need SEA, but it's giving Seattle. I'm trying to figure in the formula where that could be represented.

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,368

    Re: Pulling string from a cell

    Hi Beh,

    This might be a bit shorter. See which you like better (the one that works!)

    =TRIM(SUBSTITUTE(MID(TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",20)),40,20)),4,3),"@",""))
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Pulling string from a cell

    How about B1 copied down...

    =LEFT(MID(LEFT(A1,FIND("@",A1)-1),SEARCH("EDT",A1)+3,99),3)
    HTH
    Regards, Jeff

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,745

    Re: Pulling string from a cell

    Similar to Marvin's.
    Formula: copy to clipboard
    =LEFT(TRIM(RIGHT(SUBSTITUTE(REPLACE(A1,FIND("@",A1),99,""),"EDT",REPT(" ",99)),99)),3)

  9. #9
    Forum Contributor
    Join Date
    01-15-2015
    Location
    New York
    MS-Off Ver
    Excel 2011 MAC
    Posts
    104

    Re: Pulling string from a cell

    Yes!! Thanks excellent! - Marking it as solved

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,745

    Re: Pulling string from a cell

    Quote Originally Posted by Beh162 View Post
    Marking it as solved
    Thank you. It helps.

+ 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] Pulling a value from a string
    By Ataraxicatom in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-11-2014, 09:16 AM
  2. [SOLVED] Pulling a string of text
    By Montoro22 in forum Excel General
    Replies: 5
    Last Post: 06-11-2013, 11:36 AM
  3. Pulling a Specific Cell when Pulling a Tabel from Web Based Data
    By Zallen89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2013, 05:39 PM
  4. [SOLVED] Pulling specific text string from a cell
    By smtwidle in forum Excel General
    Replies: 6
    Last Post: 06-25-2012, 03:28 PM
  5. Pulling data from a string in a cell
    By MSP in forum Excel General
    Replies: 2
    Last Post: 10-05-2010, 02:17 PM
  6. Pulling only the number out of a string
    By bconner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2008, 03:32 PM
  7. [SOLVED] Pulling apart a string
    By Kevin O'Neill in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-06-2006, 01:32 PM

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