Hi,
I'm new to this forum so I'm not sure if this is the best place for this question. If I should post it under a different heading let me know.
I'm trying to get excel to count how many times a pair of letters appears in a string. I'm working with DNA so I'm only using A, G, C and T.
For example in a sequence GTA AAA CGA there is 1 GT pair, 1 TA pair, 3 AA pair, 1 AC pair, 1 CG pair, and 1 GA pair.
I set up columns for every possible combination and have them counted with this formula
=((LEN(C3)-LEN(SUBSTITUTE(C3,"AA","")))/2)
There was probably an easier way to do it but this worked for me.
My problem happens when there is a series of poly letters (like in the sequence above).
Any help would be appreciated! Thank you!
Bookmarks