+ Reply to Thread
Results 1 to 4 of 4

Returning text depending on spaces

  1. #1
    Registered User
    Join Date
    07-07-2010
    Location
    Cape Cod
    MS-Off Ver
    Excel 2007
    Posts
    31

    Returning text depending on spaces

    Hi,
    I have attached an example. I would like to be able to create a function that only returns text up to a certain "space' in a text string.
    Thanks in advance for taking a look at this.
    Michael
    Attached Files Attached Files
    Last edited by mlopardo; 09-09-2011 at 06:07 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Returning text depending on spaces

    As a start:

    =MID(B7,1,FIND(" ",B7,FIND(" ",B7)+1))

    You may need to be more sophisticated if there are "sentences" with one or less spaces in them.

    In 2007:

    =IFERROR(MID(B7,1,FIND(" ",B7,FIND(" ",B7)+1)),B7)


    Regards
    Last edited by TMS; 09-09-2011 at 05:44 PM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    07-07-2010
    Location
    Cape Cod
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Returning text depending on spaces

    Works great! Thanks much!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Returning text depending on spaces

    You're welcome. Thanks for the rep.

+ 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