String manipulation in Excel
String manipulation in Excel
(OP)
Dear experts,
I have a difficult task, and would appreciate your help.
In Excel, I have in each cell a DNA sequence which is a string composed of the letters a,g,c,t. For example:
cacacaaggggtgaagcttgcggcttaatggagtcaacgccggaaacctcacccggggcgacagcaggatgaagccaggctaacgaccttgccggacgagctgagaggaggtgcatggccgtcgtcagctcgtgc
What I need to do is:
1) find if this string contains in it the 1st "mini-string", aagtgaac.
2) find if this string contains in it the 2nd "mini-string", gcgcttatt.
3) IF both mini-strings are present, then COPY the part of the big string that is in the middle, i.e. bound between the two mini-strings.
Many thanks in advance!
BrCo
I have a difficult task, and would appreciate your help.
In Excel, I have in each cell a DNA sequence which is a string composed of the letters a,g,c,t. For example:
cacacaaggggtgaagcttgcggcttaatggagtcaacgccggaaacctcacccggggcgacagcaggatgaagccaggctaacgaccttgccggacgagctgagaggaggtgcatggccgtcgtcagctcgtgc
What I need to do is:
1) find if this string contains in it the 1st "mini-string", aagtgaac.
2) find if this string contains in it the 2nd "mini-string", gcgcttatt.
3) IF both mini-strings are present, then COPY the part of the big string that is in the middle, i.e. bound between the two mini-strings.
Many thanks in advance!
BrCo





RE: String manipulation in Excel
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: String manipulation in Excel
RE: String manipulation in Excel
If your search string is in cell A1, first 'mini-string' is in B1, and second 'mini-string' is in C1 then try this formula (in the cell where you want the extracted sequence):
CODE
Of course, you can modify A1, B1, and C1 as necessary in the formula.
RE: String manipulation in Excel
RE: String manipulation in Excel
RE: String manipulation in Excel
TTFN
FAQ731-376: Eng-Tips.com Forum Policies