Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
ksawyers
 
Posts: n/a
Default Combining Text Strings - Complex

Good afternoon!

I am searching for a formula that will combine all the cells within a range
based on matching other criteria. For instance, I want to concatenate all of
the comments entered for a particular name within a list of 5000 names where
the name is repeated numerous times. Can anyone help? Thanks!

Best regards,

Kerrick
  #2   Report Post  
Harlan Grove
 
Posts: n/a
Default

ksawyers wrote...
I am searching for a formula that will combine all the cells within a range
based on matching other criteria. For instance, I want to concatenate all of
the comments entered for a particular name within a list of 5000 names where
the name is repeated numerous times. Can anyone help? Thanks!


Why are you doing something like this in Excel? It's not the best tool
for text processing (not by a long shot).

If you insist on using Excel for this, then you'll have to use VBA.
Excel provides *NO* built-in means of concatenating arbitrary
collections of text strings. Both the concatenation operator, &, and
the CONCATENATE function provide only pair-wise functionality.

One possible udf (user-defined function) is mcat given in

http://groups.google.com/group/micro...e=source&hl=en

(or http://makeashorterlink.com/?S1E33459B ). With it you could use an
array formula like

=TRIM(mcat(IF(IDs=SpecificID,Comments,"")&" "))

to concatenate all comments from the range or array designated by
Comments corresponding to all IDs from the range or array designated by
IDs that match the ID given by SpecificID. This also inserts a single
space between each of the comments. Inserting a newline between each of
the comments is a bit trickier.

=SUBSTITUTE(SUBSTITUTE(TRIM(mcat(IF($C$1:$C$20=C22 ,
SUBSTITUTE(D1:D20," ","<s"),"")&" "))," ",CHAR(10)),"<s"," ")

which assumes the literal substring <s doesn't appear in your
comments. If it could, use some other string (perhaps CHAR(127)) as a
temprary placeholder for space characters in the original comments.

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
Formula to strip figures from cells text strings mikeburg Excel Discussion (Misc queries) 5 August 15th 05 10:31 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
Combining text strings Hayley Excel Worksheet Functions 6 May 5th 05 12:46 AM
Compare cells/columns and highlight matching text strings luxbelle Excel Worksheet Functions 1 February 25th 05 06:34 PM
Filter long Text strings Cimorene Excel Worksheet Functions 0 December 1st 04 04:01 AM


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