Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Isolating specific string combinations

This is a further iteration of a problem I've been working on and posted
earlier under the subject: "Isolating String Combinations."

Say you have the following data:

AB
CD
CD
CE
CD
AB
CD
AG
CD
CD
CE
CS
CD
AB
CD
CD
CF
CG
CE

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) AND that
follow "AB" (i.e., not "AG"). I want 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 that follow "AB"? Output for the above would be:

AB
CD
CD
CE
CD

AB
CD
CD
CF
CG
CE

Thoughts?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Isolating specific string combinations

Try the below formulas in B1 and B2

In B1
=IF(AND(A1="AB",COUNTIF(A2:A5,"C*")=4),A1,"")

In B2
=IF(AND(A2="AB",COUNTIF(A3:A6,"C*")=4),A2,IF(AND(B 1<"",COUNTIF(A2,"c*")=1),A2,""))

Col A Col B
AB AB
CD CD
CD CD
CE CE
CD CD
AB
CD
AG
CD
CD
CE
CS
CD
AB AB
CD CD
CD CD
CF CF
CG CG
CE CE


If this post helps click Yes
---------------
Jacob Skaria


"Demosthenes" wrote:

This is a further iteration of a problem I've been working on and posted
earlier under the subject: "Isolating String Combinations."

Say you have the following data:

AB
CD
CD
CE
CD
AB
CD
AG
CD
CD
CE
CS
CD
AB
CD
CD
CF
CG
CE

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) AND that
follow "AB" (i.e., not "AG"). I want 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 that follow "AB"? Output for the above would be:

AB
CD
CD
CE
CD

AB
CD
CD
CF
CG
CE

Thoughts?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Isolating specific string combinations

Forgot to mention to copy the formula in B2 down to B3,B4... as required
--
If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Try the below formulas in B1 and B2

In B1
=IF(AND(A1="AB",COUNTIF(A2:A5,"C*")=4),A1,"")

In B2
=IF(AND(A2="AB",COUNTIF(A3:A6,"C*")=4),A2,IF(AND(B 1<"",COUNTIF(A2,"c*")=1),A2,""))

Col A Col B
AB AB
CD CD
CD CD
CE CE
CD CD
AB
CD
AG
CD
CD
CE
CS
CD
AB AB
CD CD
CD CD
CF CF
CG CG
CE CE


If this post helps click Yes
---------------
Jacob Skaria


"Demosthenes" wrote:

This is a further iteration of a problem I've been working on and posted
earlier under the subject: "Isolating String Combinations."

Say you have the following data:

AB
CD
CD
CE
CD
AB
CD
AG
CD
CD
CE
CS
CD
AB
CD
CD
CF
CG
CE

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) AND that
follow "AB" (i.e., not "AG"). I want 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 that follow "AB"? Output for the above would be:

AB
CD
CD
CE
CD

AB
CD
CD
CF
CG
CE

Thoughts?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Isolating specific string combinations

Jacob,

Thanks! Works great.

You don't need to use the 1st formula (B1) if you have a blank row at the
top of the column.

"Jacob Skaria" wrote:

Forgot to mention to copy the formula in B2 down to B3,B4... as required
--
If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Try the below formulas in B1 and B2

In B1
=IF(AND(A1="AB",COUNTIF(A2:A5,"C*")=4),A1,"")

In B2
=IF(AND(A2="AB",COUNTIF(A3:A6,"C*")=4),A2,IF(AND(B 1<"",COUNTIF(A2,"c*")=1),A2,""))

Col A Col B
AB AB
CD CD
CD CD
CE CE
CD CD
AB
CD
AG
CD
CD
CE
CS
CD
AB AB
CD CD
CD CD
CF CF
CG CG
CE CE


If this post helps click Yes
---------------
Jacob Skaria


"Demosthenes" wrote:

This is a further iteration of a problem I've been working on and posted
earlier under the subject: "Isolating String Combinations."

Say you have the following data:

AB
CD
CD
CE
CD
AB
CD
AG
CD
CD
CE
CS
CD
AB
CD
CD
CF
CG
CE

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) AND that
follow "AB" (i.e., not "AG"). I want 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 that follow "AB"? Output for the above would be:

AB
CD
CD
CE
CD

AB
CD
CD
CF
CG
CE

Thoughts?

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
Isolating string combinations Demosthenes Excel Worksheet Functions 4 August 28th 09 06:06 PM
Combinations in a string of data Eán[_2_] Excel Worksheet Functions 4 February 27th 09 06:16 PM
isolating specific list Elle Excel Discussion (Misc queries) 8 June 29th 07 01:06 AM
isolating a string containing a % symbol bobadigilatis Excel Worksheet Functions 5 January 27th 06 11:32 PM
Isolating a custom toolbar to a specific spreadsheet Gilgamesh Excel Discussion (Misc queries) 3 October 14th 05 01:30 PM


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