+ Reply to Thread
Results 1 to 5 of 5

Extracting certain text from a cell

  1. #1
    Registered User
    Join Date
    11-05-2007
    Posts
    82

    Extracting certain text from a cell

    Hi All,

    Hoping you can help me!

    I have a text column in Excel - that I only want to extract a certain part of.

    EG:
    Cell A2: TNH6 Y (Result - TNH6)
    Cell A3: TBJHK (Result - TBJHK)
    Cell A4: TGHKGH (Result - TGHKGH)

    Bassically - what I am trying to do is extract anything up to the first space within the cell and ignore anything after the space. The cell itself will never be more than 6 digits - but the space could come on the 4th or 5th.

    Is there a function to do this - or could I create a function of my own - and how?

    Thanks.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Here's one way:

    =IF(ISERROR(FIND(" ",A2)),A2,LEFT(A2,FIND(" ",A2)-1))

  3. #3
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi Neil,

    =LEFT(A2,FIND(" ",A2))

    Ed

  4. #4
    Registered User
    Join Date
    11-05-2007
    Posts
    82
    Excellent - Thanks guys!

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Simpler than using ISERROR.....

    =LEFT(A2,FIND(" ",A2&" ")-1)

+ 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