#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Read part of a cell

Hello, I wondered if anyone could help me with the following query...I want
to read a section of text in a cell which is always the fifth word in, the
words before that are seperated by a comma and space. Thank you
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Read part of a cell

Fiona difficult without seeing how the comma/spaces are arrabged but here's a
couple of ways:-

have a look at this function
http://www.j-walk.com/ss/excel/tips/tip32.htm

Or if your 5th word is surrounded by spaces you could use the very unweildy:-

=MID(A1,SEARCH(CHAR(127),SUBSTITUTE(A1,"
",CHAR(127),4))+1,SEARCH(CHAR(127),SUBSTITUTE( A1,"
",CHAR(127),5))-SEARCH(CHAR(127),SUBSTITUTE(A1," ",CHAR(127),4))-1)

It looks for the 4th space which I have assumen immediatly precedes your 5th
word and axtracts all the text before the next space. This could just as
easily find a comma by changeing " " to ","



Mike
"Fiona" wrote:

Hello, I wondered if anyone could help me with the following query...I want
to read a section of text in a cell which is always the fifth word in, the
words before that are seperated by a comma and space. Thank you

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Read part of a cell

Thanks Mike

"Mike H" wrote:

Fiona difficult without seeing how the comma/spaces are arrabged but here's a
couple of ways:-

have a look at this function
http://www.j-walk.com/ss/excel/tips/tip32.htm

Or if your 5th word is surrounded by spaces you could use the very unweildy:-

=MID(A1,SEARCH(CHAR(127),SUBSTITUTE(A1,"
",CHAR(127),4))+1,SEARCH(CHAR(127),SUBSTITUTE( A1,"
",CHAR(127),5))-SEARCH(CHAR(127),SUBSTITUTE(A1," ",CHAR(127),4))-1)

It looks for the 4th space which I have assumen immediatly precedes your 5th
word and axtracts all the text before the next space. This could just as
easily find a comma by changeing " " to ","



Mike
"Fiona" wrote:

Hello, I wondered if anyone could help me with the following query...I want
to read a section of text in a cell which is always the fifth word in, the
words before that are seperated by a comma and space. Thank you

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Read part of a cell

Hi Mike,I've had a go at the formula and followed your link which was very
useful, but I'm still a bit stuck! I have a list containing over 800 rows.
The list shows, for example, one, two, three, four, five then on the next
row, red, yellow, green, blue, purple

I want to read on the next page of my worksheet the fifth word of that
string, and copy it down so each row reads the fifth word whatever it is.
I've tried =ExtractElement("Sheet2!C3",5,", ") but it just shows #NAME? but
I'm not sure what I'm doing wrong.

Thanks again

"Mike H" wrote:

Fiona difficult without seeing how the comma/spaces are arrabged but here's a
couple of ways:-

have a look at this function
http://www.j-walk.com/ss/excel/tips/tip32.htm

Or if your 5th word is surrounded by spaces you could use the very unweildy:-

=MID(A1,SEARCH(CHAR(127),SUBSTITUTE(A1,"
",CHAR(127),4))+1,SEARCH(CHAR(127),SUBSTITUTE( A1,"
",CHAR(127),5))-SEARCH(CHAR(127),SUBSTITUTE(A1," ",CHAR(127),4))-1)

It looks for the 4th space which I have assumen immediatly precedes your 5th
word and axtracts all the text before the next space. This could just as
easily find a comma by changeing " " to ","



Mike
"Fiona" wrote:

Hello, I wondered if anyone could help me with the following query...I want
to read a section of text in a cell which is always the fifth word in, the
words before that are seperated by a comma and space. Thank you

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
How do I include part of a cell in text (string?) in another cell? Chris Mitchell Excel Worksheet Functions 2 June 25th 07 10:08 AM
how do I read this part of a vlookup statement !1:65536,12,FALSE TJPimpact Excel Discussion (Misc queries) 1 January 11th 07 09:03 PM
macro to move part of cell contents to another cell icetoad hisself Excel Discussion (Misc queries) 4 November 27th 06 07:19 PM
Display contents of cell in another cell as part of text string? [email protected] New Users to Excel 3 July 8th 06 07:44 PM
Can you make a cell with a diagonal, so that you can edit the upper and lower part of the cell? g wills New Users to Excel 3 February 17th 05 10:23 PM


All times are GMT +1. The time now is 08:23 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"