Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
JDay01
 
Posts: n/a
Default 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   Report Post  
Duke Carey
 
Posts: n/a
Default

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   Report Post  
N Harkawat
 
Posts: n/a
Default

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

"JDay01" wrote in message
...
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   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

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

In article ,
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?

  #5   Report Post  
Duke Carey
 
Posts: n/a
Default

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


"JE McGimpsey" wrote:

One way:

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

In article ,
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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to return a value based on the status of a check box. If . JROD Excel Worksheet Functions 1 April 4th 05 08:18 PM
Return only one instance Pat Excel Worksheet Functions 4 March 9th 05 10:09 PM
Want to return a value based on a whether a number is within a ra. laurieevan Excel Worksheet Functions 3 February 24th 05 11:14 AM
Formula to return cell contents based on multiple conditions Bill Excel Worksheet Functions 3 January 19th 05 09:59 AM
Can VLOOKUP return multiple answers based on several identical lo. jddtct Excel Worksheet Functions 3 January 11th 05 07:03 AM


All times are GMT +1. The time now is 10:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"