+ Reply to Thread
Results 1 to 5 of 5

How to return # characters based on 2nd instance of value

  1. #1
    JDay01
    Guest

    How to return # characters based on 2nd instance of value

    I have a range of text fields with descriptions containing a combination of
    words and spaces. I want to return the leftmost two words of each
    description, however, the position of where the 2nd space occurs varies by
    cell.
    I have found a way to return the first word by using the following formula:
    =LEFT(E4,FIND(" ",E4)-1)) However, I cannot figure out how to return the
    TWO words. Can someone help?

  2. #2
    Duke Carey
    Guest

    RE: How to return # characters based on 2nd instance of value

    The third argument to Find() is optional, & it indicates which character
    Excel should start searching from. You could use 1+ the position of the
    first space as the starting point

    =LEFT(E4,FIND(" ",E4,1+FIND(" ",E4,1))-1))


    "JDay01" wrote:

    > I have a range of text fields with descriptions containing a combination of
    > words and spaces. I want to return the leftmost two words of each
    > description, however, the position of where the 2nd space occurs varies by
    > cell.
    > I have found a way to return the first word by using the following formula:
    > =LEFT(E4,FIND(" ",E4)-1)) However, I cannot figure out how to return the
    > TWO words. Can someone help?


  3. #3
    N Harkawat
    Guest

    Re: How to return # characters based on 2nd instance of value

    =LEFT(A1,FIND("?",SUBSTITUTE(A1," ","?",2)))

    "JDay01" <[email protected]> wrote in message
    news:[email protected]...
    >I have a range of text fields with descriptions containing a combination of
    > words and spaces. I want to return the leftmost two words of each
    > description, however, the position of where the 2nd space occurs varies by
    > cell.
    > I have found a way to return the first word by using the following
    > formula:
    > =LEFT(E4,FIND(" ",E4)-1)) However, I cannot figure out how to return the
    > TWO words. Can someone help?




  4. #4
    JE McGimpsey
    Guest

    Re: How to return # characters based on 2nd instance of value

    One way:

    =LEFT(E4,FIND("$",SUBSTITUTE(E4," ","$",2))-1)

    In article <[email protected]>,
    JDay01 <[email protected]> wrote:

    > I have a range of text fields with descriptions containing a combination of
    > words and spaces. I want to return the leftmost two words of each
    > description, however, the position of where the 2nd space occurs varies by
    > cell.
    > I have found a way to return the first word by using the following formula:
    > =LEFT(E4,FIND(" ",E4)-1)) However, I cannot figure out how to return the
    > TWO words. Can someone help?


  5. #5
    Duke Carey
    Guest

    Re: How to return # characters based on 2nd instance of value

    JE & N - I like that. It's very concise.


    "JE McGimpsey" wrote:

    > One way:
    >
    > =LEFT(E4,FIND("$",SUBSTITUTE(E4," ","$",2))-1)
    >
    > In article <[email protected]>,
    > JDay01 <[email protected]> wrote:
    >
    > > I have a range of text fields with descriptions containing a combination of
    > > words and spaces. I want to return the leftmost two words of each
    > > description, however, the position of where the 2nd space occurs varies by
    > > cell.
    > > I have found a way to return the first word by using the following formula:
    > > =LEFT(E4,FIND(" ",E4)-1)) However, I cannot figure out how to return the
    > > TWO words. Can someone help?

    >


+ 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