Counting the number of cells between occurrences

JaYMac1221

New Member
Joined
Mar 21, 2013
Messages
3
Good Morning All,

New to the board and I'm looking for a formula to count the number of non-occurrences between occurrences. Example (Homerun Hitter 1. How many at bats between each homerun, what is the longest streak between, and then calculte the standard deviation of those streaks.)

Thanks for your help.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

JaYMac1221

New Member
Joined
Mar 21, 2013
Messages
3
I just put together a quick example. How would I calculate the long streak between home runs and a list of all the streaks between home runs. Hope this makes it clearer. Thanks for the help.
At Bat1
Single
At Bat2
Fly out
At Bat3
Double
At Bat4
Home Run
At Bat5
Strike Out
At Bat6
Ground Out
At Bat7
Home Run
At Bat8
Strike Out
At Bat9
Strike Out
At Bat10
Single
At Bat11
Single
At Bat12
Home Run
At Bat13
Ground Out
At Bat14
Fly out
At Bat15
Home Run
At Bat16
Double
At Bat17
Strike Out
At Bat18
Strike Out
At Bat19
Single
At Bat20
Ground Out
At Bat21
Error
At Bat22
Fielders Choice
At Bat23
Home Run
At Bat24
Sacrifice Fly
At Bat25
Strike Out
At Bat26
Single
At Bat27
Double
At Bat28
Strike Out
At Bat29
Home Run
At Bat30
Ground Out

<tbody>
</tbody>
 
Upvote 0

JaYMac1221

New Member
Joined
Mar 21, 2013
Messages
3
Good Morning All,

I wrote a array formula to calulate the AB's since a hitters last home run{=COUNTA($B$1:$B$30)-MAX(IF($B$1:$B$30="Home Run",ROW($B$1:$B$30)))}, and tried to give an example of the data. I hope this helps you understand the data I'm trying to extract from the data base of baseball stats. Maybe there's a baseball fan out there:p.
Thanks for any help with this.

AB
1At Bat1Single
2At Bat2Fly out
3At Bat3Double
4At Bat4Home Run
5At Bat5Strike Out
6At Bat6Ground Out
7At Bat7Home Run
8At Bat8Strike Out
9At Bat9Strike Out
10At Bat10Single
11At Bat11Single
12At Bat12Home Run
13At Bat13Ground Out
14At Bat14Fly out
15At Bat15Home Run
16At Bat16Double
17At Bat17Strike Out
18At Bat18Strike Out
19At Bat19Single
20At Bat20Ground Out
21At Bat21Error
22At Bat22Fielders Choice
23At Bat23Home Run
24At Bat24Sacrifice Fly
25At Bat25Strike Out
26At Bat26Single
27At Bat27Double
28At Bat28Strike Out
29At Bat29Home Run
30At Bat30Ground Out

<colgroup><col style="width: 59pt; mso-width-source: userset; mso-width-alt: 2852;" width="78"><col style="width: 48pt;" width="64"><col style="width: 82pt; mso-width-source: userset; mso-width-alt: 3986;" width="109"><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,195,632
Messages
6,010,811
Members
441,569
Latest member
PeggyLee

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