Power Query - PGA Player Stats

Post Reply
User avatar
paspuggie48
Posts: 642
Joined: Thu Jun 20, 2013 9:22 am
Location: South-West

This Power Query solution gets the stats for 285 PGA Players.

PGA Player Stats.xlsx


It consists of all the 133 data points for each Player as per the PGA webpage; example : https://www.pgatour.com/player/34021/bud-cauley/stats


PGA Player Stats.png

The URLs for each Player reside on the Table in the "PlayerList" worksheet. This list should be up-to-date for a season but should you want to update it right-click on the Table and select "Refresh".

PGA Player List.png

On the "PlayerStats" worksheet is a Table to the far left called "Statistics". The Query uses the URL from the "PlayerList" worksheet and looks for the data points from that Statistics Table to get the information from the retrospective webpage and combines accordingly.

A drop-down option is under the headers of each PLAYER 1, PLAYER 2, PLAYER 3. A Hyperlink is also next to their name, should you wish to click and go direct to their statistics webpage.

I created 3 Player Tables just in case you wanted to compare H2Hs.

To refresh each Table, simply select a Player from the drop-downs available and right-click on the Table underneath their name and select "Refresh".

NOTE: for some reason (and I cannot work out why) it does not always recognise the data from the website and may return blank rows. If this happens simply repeat the Refresh option (usually doing this twice sorts it out).

NOTE: this uses new technology to Excel Power Query as I have an O365 package and get regular updates. So at this time I'm unsure if it will work for those with older versions.
You do not have the required permissions to view the files attached to this post.
User avatar
Eltzroth77
Posts: 1
Joined: Wed Mar 20, 2024 11:13 am
Location: Bossier City, Louisiana, USA

Great work on this! Well done! Very impressive my friend!
User avatar
Euler
Posts: 24816
Joined: Wed Nov 10, 2010 1:39 pm
Location: Bet Angel HQ

Great stuff! Especially ahead of the US Masters.
User avatar
paspuggie48
Posts: 642
Joined: Thu Jun 20, 2013 9:22 am
Location: South-West

Slightly misleading picture in my original post, so I filtered for 3 different players.

Selected Data Tab > Refresh All (twice) and it produced the following result: -

PGA Player Stats.png

I've re-attached the file as it had a column resizing issue which I sorted as well.

PGA Player Stats.xlsx
You do not have the required permissions to view the files attached to this post.
User avatar
paspuggie48
Posts: 642
Joined: Thu Jun 20, 2013 9:22 am
Location: South-West

For info:

The "Statistics" Table on the left (grey) is adjustable and those data points (rows) can be removed if required.

As an example, I randomly removed some of those rows (right-click on a row or multiple rows and Delete > Table rows) and selected Data Tab > Refresh all and it produced the following result: -

PGA Player Stats.png

Again, if it returns blank rows just select the individual Table and right-click inside that Table and "Refresh" and the data will appear.
You do not have the required permissions to view the files attached to this post.
User avatar
paspuggie48
Posts: 642
Joined: Thu Jun 20, 2013 9:22 am
Location: South-West

Euler wrote:
Fri Apr 05, 2024 11:15 am
Great stuff! Especially ahead of the US Masters.
Forgot to ask Peter if you had a go with it and if it was useful in anyway?
Post Reply

Return to “Excel Power Query”