Count amount of time a string appears

watson2012

New Member
Joined
Sep 27, 2014
Messages
1
Hi all,

I am creating a spreadsheet to record football stats of my local team, i have got most of the formulas i need so far but i am struggling with counting how many times a person has scored.

I have several pages in my file e.g Players, Cup Games, League Games

In the players page i have stats of apps etc, cup games and league games have score, lineup, scorers etc

on the players page i am trying to count how many times a player has scored this season,

Code:
=LEN('Cup Games'!AC2)-LEN(SUBSTITUTE('Cup Games'!AC2,A29,LEFT(A29,LEN(A29)-1)))

works to count for one cell where A29 is the platers name but if i try do it over the season (more than one cell) it doesnt work, this is the code i used ...

Code:
=LEN('Cup Games'!AC2:AC30)-LEN(SUBSTITUTE('Cup Games'!AC2:AC30,A29,LEFT(A29,LEN(A29)-1)))

what should my code be? obviously 1 cell may contain the players name more than once

Cheers in advance
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I don't think you can use a range like this in that function.

Could you not create a table with a column/row for each game/player using the individual cell formula for a single game and then make totals on the columns/rows?
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,748
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top