Parsing baseball box score

327

New Member
Joined
Jun 24, 2012
Messages
1
I am working on a project with baseball data from retrosheet.org. I want to create variables for the score of each team in each inning (VisInning1, HomeInning1, VisInning2, HomeInning2, etc). The problem is that the variable for the box score is coded strangely. Each team has its own variable for the whole game and each inning gets one value. Because leading zeros are cut off, a value of "12(10)1X" would mean that a team did not score in the first 4 innings, scored once in the fifth, twice in the sixth, ten times in the seventh, once in the eighth, and they did not have to play the ninth because they had won by that point. There is a variable for the total number of outs, so I can calculate whether or not there are extra innings.This is part of a project that I am doing as a gift for my father's 64th birthday in August. He's a huge baseball fan but likes leaving games early to beat the traffic. I'm writing an analysis of the likelihood of a leader change under different score conditions.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Excel Workbook
ABCDEFGHIJKLMNOP
1datahelper 1helper 2helper 3innings 1innings 2innings 3innings 4innings 5innings 6innings 7innings 8innings 9*lookuplist
212(10)1X12a1X12a1X000012a1X000012101x*00
312(11)13(12)12b13c12b13c00012b13c00012111312*11
4123456789123456789123456789123456789123456789*22
5(18)12(16)x(18)12(16)xi12gx0000i12gx0000181216x*33
6(10)(10)0(11)1(15)67xaa0b1(15)67xaa0b1f67xaa0b1f67x101001111567x*44
71xxx1xxx1xxx000001xxx000001xxx*55
8**************66
9**************77
10**************88
11**************99
12****I assumed since the modern record is17 in an innings 19 would be high enough*********a10
13**************b11
14**************c12
15**************d13
16**************e14
17**************f15
18**************g16
19**************h17
20**************i18
21**************j19
22**************xx
Sheet1
Excel Workbook
D
2000012a1X
Sheet1
Excel Workbook
EFGHIJKLM
2000012101x
Sheet1

x post at http://www.excelforum.com/excel-pro...baseball-box-score.html?p=2835647#post2835647
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,212
Members
449,214
Latest member
mr_ordinaryboy

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