Count consecutive characters within a cell
I used your second equation. Works like a dream. Thanks!
"Dave Peterson" wrote:
How about just True or False
=LEN(A1)<LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(
SUBSTITUTE(UPPER(A1),"GGGG",""),"AAAA",""),"TTTT", ""),"CCCC",""))
Or
=TRIM(
IF(LEN(A1)=LEN(SUBSTITUTE(UPPER(A1),"GGGG",""))," ","Consecutive G's ")
&IF(LEN(A1)=LEN(SUBSTITUTE(UPPER(A1),"AAAA","") )," ","Consecutive A's ")
&IF(LEN(A1)=LEN(SUBSTITUTE(UPPER(A1),"TTTT","") )," ","Consecutive T's ")
&IF(LEN(A1)=LEN(SUBSTITUTE(UPPER(A1),"CCCC","") )," ","Consecutive C's "))
Jshendel wrote:
I have a genetic sequence such as:
AATTCAGTTACTTTTGCA
I need a formula that will tell me if this cell has a run of 4 or more
consecutive letters. The run can consist of 4 or more A, T, C, or G.
The above example can return simply as "yes" or can be as complex as "this
cell has 4 consecutive T's"
Thanks,
Josh
--
Dave Peterson
|