LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Stefi
 
Posts: n/a
Default separate whole words

Hi Ron,

I think the problem is that Norika not always wants to find the last space!
E.g.
l is the 40th
character
the board of directors of abc company limited
is to be split like
the board of directors of abc company
limited

but n is the 40th character
the board of directors of abcdefghijklmno company limited
like
the board of directors of
abcdefghijklmno company limited


Regards,
Stefi

€˛Ron Rosenfeld€¯ ezt Ć*rta:

On Thu, 29 Dec 2005 02:47:19 -0600, norika
wrote:


I want to separate the following words into two rows. As the length of
each word is different, so i could not use 'text to coumns' function.
for example:
Word1 : the board of directors of abc company limited (len = 45) in
cell u13
Word2 : the board of directors of abcdefgh company limited (len =50) in
cell u14

I use the formula to separate word 1 into two rows: return #VALUE
1st row : =IF(LEN(U13)<40,U13,LEFT(U13,FIND(" ",U13,40))) in cell u15
2nd row : =IF(LEN(U15)<40," ",TRIM(MID(U13,LEN(U15),99))) in cell u16

But i use same formula to separate word2 into two rows : successful
1st row : =IF(LEN(U14)<40,U15,LEFT(U14,FIND(" ",U14,40))) in cell u17
2nd row : ==IF(LEN(U14)<40," ",TRIM(MID(U14,LEN(U17),99))) in cell u18

Answer : 1st row : the board of directors of abcdefgh company
2nd row : limited
what is the problem?

TIA

norika


If I understand you correctly, you are trying to place in the first row,
everything except the last word of the sentence; and in the second row just the
last word.

The problem is you have to find the last <space in the sentence in order to do
this.

The following formulas will do this:

1st row: (in R15)

=LEFT(U13,-1+FIND(CHAR(1),SUBSTITUTE(U13," ",
CHAR(1),LEN(U13)-LEN(SUBSTITUTE(U13," ","")))))

2nd row (if 1st row is not in R15, change that reference in the formula below):

=TRIM(SUBSTITUTE(U13,R15,""))



--ron

 
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
Open Excel files in separate sessions, not just separate windows? Bob at Dexia Design Excel Discussion (Misc queries) 1 October 18th 05 05:46 PM
how to separate words between blanks Elizabeth Excel Discussion (Misc queries) 1 July 16th 05 09:55 PM
How do I separate words in one cell into two cells? Vanessa Excel Worksheet Functions 3 June 8th 05 02:32 PM
how to separate words between blanks Mexage Excel Discussion (Misc queries) 0 May 13th 05 12:03 AM
Separate last word in cell with more than 2 words? Pat Mayton Excel Worksheet Functions 2 March 24th 05 03:37 PM


All times are GMT +1. The time now is 08:55 PM.

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

About Us

"It's about Microsoft Excel"