Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Counting the number of specified text characters within a cell

I work in a genetics lab and would like to know of a function that will count
the nucleotide designators within a cell. Say I am ordering a primer, and
have this sequence in a cell: ataacgctttaggg Is there a function that will
tell I have 4 'a's in that cell. Or is there a function that will tell me
that I have 6 (c's and g's) in the cell.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default Counting the number of specified text characters within a cell

You could use something like this:

=LEN(A1)-LEN(SUBSTITUTE(A1,"a",""))

This would give you the number of "a"s.

To get the numbers of "c"s and "g"s together, you could use:

=LEN(A1)*2-LEN(SUBSTITUTE(A1,"c",""))-LEN(SUBSTITUTE(A1,"g",""))

Basically, these formulas just compare the length (# of characters) of the
original sequence to the length of the sequence without the specified
letter(s).

HTH,
Elkar



"FlipperT" wrote:

I work in a genetics lab and would like to know of a function that will count
the nucleotide designators within a cell. Say I am ordering a primer, and
have this sequence in a cell: ataacgctttaggg Is there a function that will
tell I have 4 'a's in that cell. Or is there a function that will tell me
that I have 6 (c's and g's) in the cell.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Counting the number of specified text characters within a cell

If case does not matter:

=LEN(A1)-LEN(SUBSTITUTE(A1,"a",""))
or
=LEN(A1)-LEN(SUBSTITUTE(SUBSTITUTE(A1,"c",""),"g",""))

If case does matter:

=LEN(A1)-LEN(SUBSTITUTE(SUBSTITUTE(A1,"A",""),"a",""))
or
=LEN(A1)-LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1 ,"C",""),"c",""),"G",""),"g",""))

--
HTH,
Laura Cook
Neenah, WI


"FlipperT" wrote in message
...
I work in a genetics lab and would like to know of a function that will
count
the nucleotide designators within a cell. Say I am ordering a primer, and
have this sequence in a cell: ataacgctttaggg Is there a function that
will
tell I have 4 'a's in that cell. Or is there a function that will tell me
that I have 6 (c's and g's) in the cell.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 208
Default Counting the number of specified text characters within a cell

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"A",""))

--
Regards,
Luc.

"Festina Lente"


"FlipperT" wrote:

I work in a genetics lab and would like to know of a function that will count
the nucleotide designators within a cell. Say I am ordering a primer, and
have this sequence in a cell: ataacgctttaggg Is there a function that will
tell I have 4 'a's in that cell. Or is there a function that will tell me
that I have 6 (c's and g's) in the cell.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically printing psted text over 250 characters to another cell Hobart007 Excel Worksheet Functions 1 July 14th 06 12:12 PM
Count Number of Characters in a cell? AHJuncti Excel Discussion (Misc queries) 2 June 16th 05 07:39 PM
Defining a number in a cell by text then subtracting it by the tex Crowraine Excel Worksheet Functions 1 December 16th 04 08:49 AM
Formatting a cell as "text" in the number catagory. Ed Excel Worksheet Functions 3 December 7th 04 08:12 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 08:16 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"