Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default Trimming text from the end of cell contents.


Hi

I need help with a small problem.

I have a column which has rows each of which end with 'Ref : ' and then
a number.

I'd like to be able to trim all of this from the end of each cell ,
leaving the rest of the cell content intact.

Can someone help?

Grateful for any advice.



Best Wishes


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,276
Default Trimming text from the end of cell contents.

Hi,
assuming your test start in cell A1 in B1 enter

=TRIM(LEFT(A1,FIND("Ref",A1)-1))

if this helps please clikc yes thanks

"Colin Hayes" wrote:


Hi

I need help with a small problem.

I have a column which has rows each of which end with 'Ref : ' and then
a number.

I'd like to be able to trim all of this from the end of each cell ,
leaving the rest of the cell content intact.

Can someone help?

Grateful for any advice.



Best Wishes



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Trimming text from the end of cell contents.

You should add the colon after the "Ref" so as to avoid false positives with
words such as "refined", "bereft", and so on. The only problem is to know
where the colon goes... the OP shows a space between the "f" and the
colon... I'm willing to bet that is a typo. Assuming the colon follows the
"f" immediately, the OP should probably use...

=TRIM(LEFT(A1,FIND("Ref:",A1)-1))

--
Rick (MVP - Excel)


"Eduardo" wrote in message
...
Hi,
assuming your test start in cell A1 in B1 enter

=TRIM(LEFT(A1,FIND("Ref",A1)-1))

if this helps please clikc yes thanks

"Colin Hayes" wrote:


Hi

I need help with a small problem.

I have a column which has rows each of which end with 'Ref : ' and then
a number.

I'd like to be able to trim all of this from the end of each cell ,
leaving the rest of the cell content intact.

Can someone help?

Grateful for any advice.



Best Wishes




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Trimming text from the end of cell contents.

It would help to see a sample line of data because you might be able to use
the Data, Text to Columns command if we saw a consistant pattern in the data.

Additionally, if Ref : only appears once you could use

=LEFT(A1,FIND(":",A1)-6)

It looks to me as though you have a space between Ref and :. If not change
the -6 to -5.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Colin Hayes" wrote:


Hi

I need help with a small problem.

I have a column which has rows each of which end with 'Ref : ' and then
a number.

I'd like to be able to trim all of this from the end of each cell ,
leaving the rest of the cell content intact.

Can someone help?

Grateful for any advice.



Best Wishes



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default Trimming text from the end of cell contents.

In article , Rick Rothstein
writes
You should add the colon after the "Ref" so as to avoid false positives with
words such as "refined", "bereft", and so on. The only problem is to know
where the colon goes... the OP shows a space between the "f" and the
colon... I'm willing to bet that is a typo. Assuming the colon follows the
"f" immediately, the OP should probably use...

=TRIM(LEFT(A1,FIND("Ref:",A1)-1))


Hi All

OK thanks for your suggestions - all of which did the trick and solved
my problem. It works perfectly.

Just a FYI - there *is* a space after 'Ref' and before the colon , so I
was able to modify slightly the code to fit.

Not sure what 'OP' means....

^_^


Thanks again.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
Default Trimming text from the end of cell contents.

:-) Original Poster. that's you...

"Colin Hayes" wrote:

In article , Rick Rothstein
writes
You should add the colon after the "Ref" so as to avoid false positives with
words such as "refined", "bereft", and so on. The only problem is to know
where the colon goes... the OP shows a space between the "f" and the
colon... I'm willing to bet that is a typo. Assuming the colon follows the
"f" immediately, the OP should probably use...

=TRIM(LEFT(A1,FIND("Ref:",A1)-1))


Hi All

OK thanks for your suggestions - all of which did the trick and solved
my problem. It works perfectly.

Just a FYI - there *is* a space after 'Ref' and before the colon , so I
was able to modify slightly the code to fit.

Not sure what 'OP' means....

^_^


Thanks again.


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Trimming text from the end of cell contents.

Then I presume you are using this...

=TRIM(LEFT(A1,FIND("Ref :",A1)-1))

OP is an abbreviation for "Original Poster"... saves us from having to look
back to see if the OP used a real name or an odd non-name.

--
Rick (MVP - Excel)


"Colin Hayes" wrote in message
...
In article , Rick Rothstein
writes
You should add the colon after the "Ref" so as to avoid false positives
with
words such as "refined", "bereft", and so on. The only problem is to know
where the colon goes... the OP shows a space between the "f" and the
colon... I'm willing to bet that is a typo. Assuming the colon follows the
"f" immediately, the OP should probably use...

=TRIM(LEFT(A1,FIND("Ref:",A1)-1))


Hi All

OK thanks for your suggestions - all of which did the trick and solved my
problem. It works perfectly.

Just a FYI - there *is* a space after 'Ref' and before the colon , so I
was able to modify slightly the code to fit.

Not sure what 'OP' means....

^_^


Thanks again.


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Trimming text from the end of cell contents.

Shane Devenshire wrote...
....
Additionally, if Ref : only appears once you could use

=LEFT(A1,FIND(":",A1)-6)


No, if : appears just once, your formula would work. If there were
other, preceding colons, your formula would fubar.

If the OP really does want to remove this stuff, and if there were
only just one instance of 'Ref : #...' in each cell, wouldn't it have
been faster for the OP to replace

Ref : *

with nothing using Edit Replace?
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default Trimming text from the end of cell contents.

In article , Rick Rothstein
writes
Then I presume you are using this...

=TRIM(LEFT(A1,FIND("Ref :",A1)-1))

OP is an abbreviation for "Original Poster"... saves us from having to look
back to see if the OP used a real name or an odd non-name.



Hi Rick

Yes , that's the one I'm using. It fits the bill perfectly.


Thanks too for acronym clarification.


Best Wishes
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
Trimming/Truncating Text Field in Excel billbrandi Excel Discussion (Misc queries) 3 August 3rd 08 05:29 AM
Trimming text scott Excel Worksheet Functions 4 December 16th 06 04:49 PM
Trimming cell contents? Jeremy Turner Excel Worksheet Functions 4 June 19th 06 03:00 PM
Grid column display text trimming ExcellUser Excel Discussion (Misc queries) 0 December 13th 05 05:21 PM
Text to Columns in excel for delimited files - allow trimming opt. D. Young New Users to Excel 1 April 25th 05 05:06 PM


All times are GMT +1. The time now is 10:31 PM.

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"