Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How do I count occurances of a specific character in a range?
I collect stats for a sports team, and the sheet used tracks Goals (G),
Assists (A) and Shots (I) all in the same cell, with one cell per period. What I need to be able to do is track the number of times a "G" comes up in a period for a team, as well as over all the periods of the game for the specific player. COUNT seems to be all-or-none for the entire cell (match or doesn't match), while FIND/SEARCH only returns the first incidence of the character (so if two goals are scored by the same player in the same period, only the first gets recorded) So, If I were to use the following data list, what could I put at "the bottom" in order to give a Goals Total for that period? AA GGI G IG A A Please & Thanx! - Jason |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How do I count occurances of a specific character in a range?
To count the number of G's in a single cell:
=len(a1)-len(substitute(a1,"G","")) to count the number of G's or g's (upper or lower) in a single cell: =len(a1)-len(substitute(upper(a1),"G","")) To count the number of G's in a contiguous range: =sumproduct(len(a1:a10)-len(substitute(a1:a10,"G",""))) To count the number of G's or g's in a contigous range: =sumproduct(len(a1:a10)-len(substitute(upper(a1:a10),"G",""))) Viridel wrote: I collect stats for a sports team, and the sheet used tracks Goals (G), Assists (A) and Shots (I) all in the same cell, with one cell per period. What I need to be able to do is track the number of times a "G" comes up in a period for a team, as well as over all the periods of the game for the specific player. COUNT seems to be all-or-none for the entire cell (match or doesn't match), while FIND/SEARCH only returns the first incidence of the character (so if two goals are scored by the same player in the same period, only the first gets recorded) So, If I were to use the following data list, what could I put at "the bottom" in order to give a Goals Total for that period? AA GGI G IG A A Please & Thanx! - Jason -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count occurances within a date range | Excel Discussion (Misc queries) | |||
count number of occurances of a word in a range | Excel Worksheet Functions | |||
Count occurances in range of cells | Excel Worksheet Functions | |||
count date occurances in range of dates... | Excel Worksheet Functions | |||
Count the occurances of a month in a range of date fields | Excel Worksheet Functions |