View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sam Wilson Sam Wilson is offline
external usenet poster
 
Posts: 523
Default Isolating string combinations

Hi,

You can do it with two helper columns. I'm assuming your column starts from
A2:

In B2 use the following and copy down
=IF(LEFT(A2,1) = LEFT(A1,1),B1,ROW())

In C2 use the following and copy down
=IF(COUNTIF(B:B,B2)3,A2,IF(COUNTIF(B:B,B3)4,A2," "))

Column C is then your helper column.

Sam


"Demosthenes" wrote:

This is a further iteration of a problem I've been working on and posted
earlier under the subject: "Question for Mr. T. Valko." The question is now
up for general consideration.

Say you have the following data:

AB
CD
CD
CE
CD
CF
AG
CD
CD
AB
CD
AB
CD
AB
CD
CF
CG
CE
CW

Which can be in one or two columns. I'm trying to analyze the makeup of the
"CX" occurrences (i.e., whether they are CD, CF, CG, etc), but ONLY IN CHAINS
longer than 4 occurrences (i.e., 4 C's in a row or longer). I could do this
if only I could figure out a way to create a helper column that is composed
of just these instances that I'm considering. So my question is: How do I
create a helper column that is composed of only the chains of 4 or longer?
Output for the above would be:

AB
CD
CD
CE
CD
CF

AB
CD
CF
CG
CE
CW

Does anyone have any thoughts on an easy way to do this?