Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Bhupinder Rayat
 
Posts: n/a
Default Omit the first word from a cell contain text

Hi all,

I have a column of cells containing text strings, and I want to omit the
first word from each cell, which are of varying character lengths. I can do
it the long winded way using a combination of the text functions (i.e. left,
mid etc..), but is there a quicker way to omit the first word? The character
lengths of the first word vary from 4 to about 9 characters. I have over
10000 cells to check.

Any help would be much appreciated.

Regards,


Bhupinder Rayat
  #2   Report Post  
Roger Govier
 
Posts: n/a
Default Omit the first word from a cell contain text

Hi
Presumably there is a space between the words. If so, then in another column
=MID(A1,FIND(" ",A1)+1,255)
Change the 255 if necessary, i.e. if there are likely to be more than 255
characters after the first space.

Regards

Roger Govier


Bhupinder Rayat wrote:
Hi all,

I have a column of cells containing text strings, and I want to omit the
first word from each cell, which are of varying character lengths. I can do
it the long winded way using a combination of the text functions (i.e. left,
mid etc..), but is there a quicker way to omit the first word? The character
lengths of the first word vary from 4 to about 9 characters. I have over
10000 cells to check.

Any help would be much appreciated.

Regards,


Bhupinder Rayat

  #3   Report Post  
Bhupinder Rayat
 
Posts: n/a
Default Omit the first word from a cell contain text

Thanks Roger,

Your formula didn't give the first word but worked from right to left, but
it put me on the right track, i used

=LEFT(C2,FIND(" ",C2))

Thanks again,

Bhupinder.
"Roger Govier" wrote:

Hi
Presumably there is a space between the words. If so, then in another column
=MID(A1,FIND(" ",A1)+1,255)
Change the 255 if necessary, i.e. if there are likely to be more than 255
characters after the first space.

Regards

Roger Govier


Bhupinder Rayat wrote:
Hi all,

I have a column of cells containing text strings, and I want to omit the
first word from each cell, which are of varying character lengths. I can do
it the long winded way using a combination of the text functions (i.e. left,
mid etc..), but is there a quicker way to omit the first word? The character
lengths of the first word vary from 4 to about 9 characters. I have over
10000 cells to check.

Any help would be much appreciated.

Regards,


Bhupinder Rayat


  #4   Report Post  
Bruno Campanini
 
Posts: n/a
Default Omit the first word from a cell contain text

"Bhupinder Rayat" wrote in
message ...
Hi all,

I have a column of cells containing text strings, and I want to omit the
first word from each cell, which are of varying character lengths. I can
do
it the long winded way using a combination of the text functions (i.e.
left,
mid etc..), but is there a quicker way to omit the first word? The
character
lengths of the first word vary from 4 to about 9 characters. I have over
10000 cells to check.

Any help would be much appreciated.

Regards,


Bhupinder Rayat


As far as more than 10000 cells is concerned, I think it would
be quicker and easier to do the job with VBA code.
It it is ok for you, please tell me if you want the result in a new
column or if you want the original column modified.

Ciao
Bruno


  #5   Report Post  
Ian
 
Posts: n/a
Default Omit the first word from a cell contain text

You asked to omit the first word (ie miss it out) which Roger's solution
did. Your solution extracts the first word with the following space. Try
this to only extract the word.

=LEFT(C2,FIND(" ",C2)-1)

--
Ian
--
"Bhupinder Rayat" wrote in
message ...
Thanks Roger,

Your formula didn't give the first word but worked from right to left, but
it put me on the right track, i used

=LEFT(C2,FIND(" ",C2))

Thanks again,

Bhupinder.
"Roger Govier" wrote:

Hi
Presumably there is a space between the words. If so, then in another
column
=MID(A1,FIND(" ",A1)+1,255)
Change the 255 if necessary, i.e. if there are likely to be more than 255
characters after the first space.

Regards

Roger Govier


Bhupinder Rayat wrote:
Hi all,

I have a column of cells containing text strings, and I want to omit
the
first word from each cell, which are of varying character lengths. I
can do
it the long winded way using a combination of the text functions (i.e.
left,
mid etc..), but is there a quicker way to omit the first word? The
character
lengths of the first word vary from 4 to about 9 characters. I have
over
10000 cells to check.

Any help would be much appreciated.

Regards,


Bhupinder Rayat






  #6   Report Post  
Roger Govier
 
Posts: n/a
Default Omit the first word from a cell contain text

Ah!, if only you had said Extract instead of Omit<bg
Glad you worked it out, and thanks for the feedback.

Incidentally, your formula should be
=LEFT(C2,FIND(" ",C2)-1)
As it stands, it will pick up the trailing space after each word which could
give you a problem later if you were trying to do a Lookup or some other task.

If you have already carried out the task, then
=TRIM(A1) or whatever cell you had the formula in, and copied down would
remove any extraneous spaces.


Regards

Roger Govier


Bhupinder Rayat wrote:
Thanks Roger,

Your formula didn't give the first word but worked from right to left, but
it put me on the right track, i used

=LEFT(C2,FIND(" ",C2))

Thanks again,

Bhupinder.
"Roger Govier" wrote:


Hi
Presumably there is a space between the words. If so, then in another column
=MID(A1,FIND(" ",A1)+1,255)
Change the 255 if necessary, i.e. if there are likely to be more than 255
characters after the first space.

Regards

Roger Govier


Bhupinder Rayat wrote:

Hi all,

I have a column of cells containing text strings, and I want to omit the
first word from each cell, which are of varying character lengths. I can do
it the long winded way using a combination of the text functions (i.e. left,
mid etc..), but is there a quicker way to omit the first word? The character
lengths of the first word vary from 4 to about 9 characters. I have over
10000 cells to check.

Any help would be much appreciated.

Regards,


Bhupinder Rayat


  #7   Report Post  
Bruno Campanini
 
Posts: n/a
Default Omit the first word from a cell contain text

"Bruno Campanini" wrote in message
...

As far as more than 10000 cells is concerned, I think it would
be quicker and easier to do the job with VBA code.
It it is ok for you, please tell me if you want the result in a new
column or if you want the original column modified.

Ciao
Bruno


The following code does the job writing a new column:

================================
Sub FirstWordOnly()
Dim StartRange As Range, TargetRange As Range
Dim i, j As Long

' Definitions
' ------------------------------
Set StartRange = [Sheet2!A292]
Set TargetRange = [Sheet2!B292]
' ------------------------------

Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
On Error GoTo ErrHandler

For Each i In Range(StartRange, StartRange.End(xlDown))
j = j + 1
TargetRange.Offset(j - 1, 0) = Left(i, InStr(1, i, " ") - 1)
Next

Exit_Sub:
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Exit Sub

ErrHandler:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description & vbCrLf & _
"Procedu FirstWordOnly" & vbCrLf & _
ThisWorkbook.FullName
Resume Exit_Sub

End Sub
==============================

Ciao
Bruno


  #8   Report Post  
Bob Miller
 
Posts: n/a
Default Omit the first word from a cell contain text


or =RIGHT(A1,LEN(A1)-FIND(" ",A1)). It doesn't care how many characters
there are in A1.
Roger Govier Wrote:
Hi
Presumably there is a space between the words. If so, then in another
column
=MID(A1,FIND(" ",A1)+1,255)
Change the 255 if necessary, i.e. if there are likely to be more than
255
characters after the first space.

Regards

Roger Govier


Bhupinder Rayat wrote:
Hi all,

I have a column of cells containing text strings, and I want to omit
the
first word from each cell, which are of varying character lengths. I
can do
it the long winded way using a combination of the text functions (i.e.
left,
mid etc..), but is there a quicker way to omit the first word? The
character
lengths of the first word vary from 4 to about 9 characters. I have
over
10000 cells to check.

Any help would be much appreciated.

Regards,


Bhupinder Rayat



--
Bob Miller
  #9   Report Post  
Roger Govier
 
Posts: n/a
Default Omit the first word from a cell contain text

Very true Bob. A much better solution, but regrettably the OP has since
posted to say he wanted to extract the word, not omit it so he has used the
LEFT function.

Regards

Roger Govier


Bob Miller wrote:
or =RIGHT(A1,LEN(A1)-FIND(" ",A1)). It doesn't care how many characters
there are in A1.
Roger Govier Wrote:

Hi
Presumably there is a space between the words. If so, then in another
column
=MID(A1,FIND(" ",A1)+1,255)
Change the 255 if necessary, i.e. if there are likely to be more than
255
characters after the first space.

Regards

Roger Govier


Bhupinder Rayat wrote:
Hi all,

I have a column of cells containing text strings, and I want to omit
the
first word from each cell, which are of varying character lengths. I
can do
it the long winded way using a combination of the text functions (i.e.
left,
mid etc..), but is there a quicker way to omit the first word? The
character
lengths of the first word vary from 4 to about 9 characters. I have
over
10000 cells to check.

Any help would be much appreciated.

Regards,


Bhupinder Rayat




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 set text to top of cell next to wrap text in Excel? Carpenter Gary New Users to Excel 1 October 25th 05 06:26 PM
Text in formula bar is not displaying in cell Mike Excel Discussion (Misc queries) 0 August 29th 05 09:47 PM
Split Long Text Cell into Two Shorter Cells Without Splitting Word Naomi T Excel Discussion (Misc queries) 1 July 7th 05 06:49 AM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
Cell set to wrap text and blank line -- fix? Fred Holmes Excel Discussion (Misc queries) 0 January 25th 05 07:10 PM


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