Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Cleanly Trimming text...

To start with, I am creating a string, based on concatenating a large
number of attributes(cells).
Essentially using this formula for that:

=IF(ISBLANK(A2),"",A2&" ")&IF(ISBLANK(B2),"",B2&" ")...

So if you have a better way, I like to learn it.

My current question revolves around this background.
I need to limit the string to under 255.
I can find a few way to trim these, I am leaning towards the MID
function, but if I simply chop at 255 it will undoubtedly chop off mid
attribute or even mid word.

I even went as far as trying to use the search function to get the
location of a space closest to 255, but search and find seem to ONLY
look for the first instance of a character, there is no way to specify
last (or better yet search right to left).

So any suggestions out there?
TIA

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Cleanly Trimming text...

if i got u right, try :

=A2&" "&B2&" "&C2&" "&D2&" "&2&.....

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Cleanly Trimming text...

=LEFT((A2 & B2 & C2),255)





wrote in message
oups.com...
To start with, I am creating a string, based on concatenating a large
number of attributes(cells).
Essentially using this formula for that:

=IF(ISBLANK(A2),"",A2&" ")&IF(ISBLANK(B2),"",B2&" ")...

So if you have a better way, I like to learn it.

My current question revolves around this background.
I need to limit the string to under 255.
I can find a few way to trim these, I am leaning towards the MID
function, but if I simply chop at 255 it will undoubtedly chop off mid
attribute or even mid word.

I even went as far as trying to use the search function to get the
location of a space closest to 255, but search and find seem to ONLY
look for the first instance of a character, there is no way to specify
last (or better yet search right to left).

So any suggestions out there?
TIA



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Cleanly Trimming text...

Okay I like the LEFT method, better then the MID method, but it still
will not chop off gracefully. I would rather have 8 attributes in the
string taking up 240 characters, then 9 attributes at 255 with the 9th
attribute being cut off.

HotRod wrote:
=LEFT((A2 & B2 & C2),255)





wrote in message
oups.com...
To start with, I am creating a string, based on concatenating a large
number of attributes(cells).
Essentially using this formula for that:

=IF(ISBLANK(A2),"",A2&" ")&IF(ISBLANK(B2),"",B2&" ")...

So if you have a better way, I like to learn it.

My current question revolves around this background.
I need to limit the string to under 255.
I can find a few way to trim these, I am leaning towards the MID
function, but if I simply chop at 255 it will undoubtedly chop off mid
attribute or even mid word.

I even went as far as trying to use the search function to get the
location of a space closest to 255, but search and find seem to ONLY
look for the first instance of a character, there is no way to specify
last (or better yet search right to left).

So any suggestions out there?
TIA


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 text from the end of cell contents. Colin Hayes Excel Worksheet Functions 8 September 1st 09 01:07 AM
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
Grid column display text trimming ExcellUser Excel Discussion (Misc queries) 0 December 13th 05 05:21 PM
Trimming text contained in cells ToddG Excel Programming 2 June 11th 04 07:46 AM


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