how do I count the total number of characters in a excell cell?

T

ty

Here are 5000 or so genes for a bacterial genome listed in my Excell 2007.
There are two columns. col (1) lists the gene names and col(2) lists the
corresponding nucleotides sequence like ATTCGGGG.....

is there a simple way to count the number of nucleotides (characters) in
each cell?
 
D

Dave Peterson

=len(a1)
will tell you the length of the string in A1.

=(len(a1)-len(substitute(a1,b1,"")))/len(b1)
will tell you the number of times B1 appears in A1.
 
D

Dave Peterson

ps. If you want to make the count case-insensitive (ASDF and aSdF and asdf are
all the same):

=(len(a1)-len(substitute(upper(a1),upper(b1),"")))/len(b1)
 
R

ryguy7272

Say the nucleotide designator is:
ataacgctttaggg

Use this to count the 'a' characters:
=LEN(A1)-LEN(SUBSTITUTE(A1,"a",""))

Use this to count the 'c' and 'g' characters:
=LEN(A1)*2-LEN(SUBSTITUTE(A1,"c",""))-LEN(SUBSTITUTE(A1,"g",""))

Finally, use this to count all 'a' characters in a range (say A1:A3):
=SUM(LEN(A1:A3)-LEN(SUBSTITUTE(A1:A3,"a","")))
This function needs to be entered with ctrl + shift + enter (not just enter)


Regards,
Ryan---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top