+ Reply to Thread
Results 1 to 9 of 9

Deleting text from cell after a space?

  1. #1
    Registered User
    Join Date
    04-23-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    12

    Deleting text from cell after a space?

    Hi, I have a Database which I need only one contact name for each company.
    Unfortunately, there is up to 5 different names in each cell. Eg. "Smith Jones Walton Davies Wilson"

    Could anyone help me with a formula that lets me just keep the first name in the cell… "Smith"

    Thanks guys!

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: Deleting text from cell after a space?

    Hi,

    Try this:

    =LEFT(A1,FIND(" ",A1)-1)
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    04-23-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Deleting text from cell after a space?

    Hiya Sweep, thanks, I have already tried this one… it didn't quite fit into my database.

    Could you perhaps talk me through this Formula please? So that I can change the cell numbers to my database! If that makes sense?

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: Deleting text from cell after a space?

    Sure.

    LEFT(A1,5) will return the 5 leftmost characters in cell A1, so if A1 contains "abcdefghij", it would return "abcde"

    FIND(" ",A1) will return the first occurrence of a space in cell A1. If A1 contains "abcde fghi", it would return 6.

  5. #5
    Registered User
    Join Date
    04-23-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Deleting text from cell after a space?

    Hiya Sweep, thanks for this, but this makes it complicated for when I save this as a .csv for import into our Customer Management software.

    Is there anyway I can be left with just the first surname without using a formula? Maybe a Macro for going into each cell individually, to remove the remaining names after the first one in each cell ?

    (If this makes sense)
    Life is like a box of chocolates - It makes you fat !

  6. #6
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: Deleting text from cell after a space?

    You could,

    Use the formula,

    Select all the cells that contain the formula,

    Do Edit > Copy

    then Edit> Paste Special > Values

    If you must use code, this will get you started:

    Please Login or Register  to view this content.
    Adjust ranges to suit your data.
    Last edited by sweep; 02-09-2011 at 10:04 AM.

  7. #7
    Registered User
    Join Date
    04-23-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Deleting text from cell after a space?

    DUDE... found an easier way... 'Text to columns'

  8. #8
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: Deleting text from cell after a space?

    Glad it worked out for you, but didn't you want a formula?

    Could anyone help me with a formula.......

  9. #9
    Registered User
    Join Date
    04-23-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Deleting text from cell after a space?

    Yes!!! I did ask for a formula.. Cos I thought when I had done it before at an Excel class,
    I thought it was a formula! My apologies!

    However, your time was not wasted, I learned new things today from your answer!
    I learned that data created from formulas can be copied and pasted as values!! Very grateful !

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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