Don’t you hate it when your fantasy platform does not let you download a CSV of player stats so you have to copy/paste formatted web pages like a caveman? If so, then you will appreciate this if you are like me and don’t have a handy way of getting stats like Quality Starts. Just for you, I went deep in the cave and copied and pasted Yahoo’s statistics for all the players they had in their database for the 2023 season. The sheet is linked below for free.
Once you stop punching the air, click this subscribe button
If this helps you at all, please consider buying me a cup of coffee: Caffeine Fund
Here is the '23 Yahoo Category Stats sheet that you can make a copy of: https://docs.google.com/spreadsheets/d/1_1oeJNQhembEWl3LeGXN81O-qoCuTSQoGuh6OrcW0ro/edit?usp=sharing
If you are interested in how to format a sheet like this keep reading…
How to?
Below is the output you will see when you copy and paste from the Yahoo player page. There are artifacts from the star icon, player names still have links to player pages, also IL, DTD, NA, and other alerts come through as multi-line cells. Here is how you clean that up.
1. For the multi-line cells you can use the SPLIT Function. Just separate by “CHAR(10)”.
(Documentation: https://tinyurl.com/splitfunc)
Function = SPLIT( B5 , CHAR(10) , true )
Apparently, every time you are typing and hit ctrl+enter in a cell it adds CHAR(10) which represents a linebreak #TheMoreYouKnow.
2. Next use SPLIT to separate the single line text. The copy/paste reveals 3 player note statuses: “New Player Note”, “No new player Notes” and “Player Note”. You can filter out each status and use 3 different SPLIT functions to clean this up… or do it the right way (the way I should have done it) and use this function:
=IF(
IFERROR( SEARCH ("No new player Notes",C5) ,false),
split(C5,"No new player Notes",false),
IF(
IFERROR (SEARCH("New Player Note",C5) ,false),
split(C5,"New Player Note",false),
split(C5,"Player Note",false)
)
)
You have to include the IFERROR because SEARCH will not result in a false statement if it cannot find text (it returns #VALUE).
3. Keep separating the string by spaces or “ “. This will break each word apart and into a cell.
Function =SPLIT ( G10, “ “, false)
4. Use CONCATENATE to combine first & last names. For Acuña we need to keep the “Jr.” so his function combines 3 cells not just 2. If you have 1549 rows in a dataset like I do, you can filter out long names (any row with values in column M or N below) and drag down your functions that match or write an IF function that checks for everything… I just found it easier to filter and copy/paste.
5. The last step is combining all the data. I used a fake Yahoo league and changed commissioner scoring settings to collect all the available statistics. Yahoo limited me to 15 categories each time so that is 3 pages of batter raw data and 4 pages of pitcher raw data which I included with the sheet.
To combine I used UNIQUE to collect a full list of all the batters and pitchers onto two new tabs, making sure to copy/paste-values-only to remove the UNIQUE function.
Then used QUERY to collect all statistics on each raw data tab where a player’s name was found.
=query('[Raw Data] Bat 1'!$M$1:$AM,
"Select X, Y, Z, AA, AB, AC, AD, AE, AF, AG, AH, AI, AJ, AK, AL, AM
where M = """&A5&"""",0)
Repeat that 7 times with all batter and pitcher data to result in a complete list. I have been doing this for a few years and I normally send a strongly worded email to Yahoo each time I finish. They have yet to provide any sort of download functionality so in the meantime you too can now join the cavemen of sabermetrics and ctrl+C/ctrl+V your way to any data set imaginable.
What do I do with all this data?
First, subscribe to my substack so you don’t miss future Google Sheets tools.
Second, actually read the next post because I am building an offseason tool to help you remember in March why your team was terrible this year.
This is such a fantastic resource. I've manually done this in the past and it's such a chore. Super informative article, too!