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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Steph77

Board Regular
Joined
Sep 18, 2014
Messages
119
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?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,117
Messages
5,835,484
Members
430,358
Latest member
zzc1128

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
Top