ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do I count the total number of characters in a excell cell? (https://www.excelbanter.com/excel-programming/413911-how-do-i-count-total-number-characters-excell-cell.html)

ty

how do I count the total number of characters in a excell cell?
 
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?

PCLIVE

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


=LEN(A1)

This includes spaces and other non-visible characters.

Regards,
Paul

--

"ty" wrote in message
...
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?




Dave Peterson

how do I count the total number of characters in a excell cell?
 
=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.

ty wrote:

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?


--

Dave Peterson

Dave Peterson

how do I count the total number of characters in a excell cell?
 
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)

ty wrote:

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?


--

Dave Peterson

ryguy7272

how do I count the total number of characters in a excell cell
 
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---
--
RyGuy


"Dave Peterson" wrote:

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)

ty wrote:

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?


--

Dave Peterson


Douglas Klimesh

how do I count the total number of characters in a excell cell?
 
ty wrote:
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?


Note that you should format col (1) as text before loading the data to
prevent some gene names from getting automatically converted into dates.
I mention this because it was a big enough issue a while ago to make
the news (http://www.theregister.co.uk/2004/07...vanishing_dna/)
and a scientific journal (http://www.biomedcentral.com/1471-2105/5/80).


All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com