Sports Stats - Stacking Games based on Player (Problem with Home/Away)

larinda4

Board Regular
Joined
Nov 15, 2021
Messages
73
Office Version
  1. 365
Platform
  1. Windows
I'll try to explain this as best as I can and I have included screenshots.

I want to stack information based on player.

I have two sheets, one called "Score Sheets" where I enter the weekly scoresheets and another called "Player Stats".

I have my player name is cell D1 of "Player Stats" and I want it to pull from "Score Sheets" either home or away based on the player name in D1. I want it to show Player Name, Handicap, Total, Win/Loss but it doesn't need to show the opponent.

For example, if the player was home, it would take columns C:G of that row and create a new list off to the side in the "Player Stats" sheet. If they were away, it would take columns S:W of that row and add it to the created list off to the side.

I've been racking my brain trying to think of a formula for this but now I'm thinking maybe I'd need to create a code?
 

Attachments

  • WVEBL Pic.PNG
    WVEBL Pic.PNG
    67.6 KB · Views: 22
  • WVEBL Pic - Dashboard.PNG
    WVEBL Pic - Dashboard.PNG
    8.4 KB · Views: 25

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
How about
Excel Formula:
=VSTACK(FILTER(CHOOSECOLS('Score Sheets'!D2:G1000,1,2,-1),'Score Sheets'!B2:B1000=D1),FILTER(CHOOSECOLS('Score Sheets'!T2:W1000,1,2,-1),'Score Sheets'!R2:R1000=D1))
 
Upvote 0
Solution
How about
Excel Formula:
=VSTACK(FILTER(CHOOSECOLS('Score Sheets'!D2:G1000,1,2,-1),'Score Sheets'!B2:B1000=D1),FILTER(CHOOSECOLS('Score Sheets'!T2:W1000,1,2,-1),'Score Sheets'!R2:R1000=D1))
Thanks Fluff for the help!

It's working for the most part. I have tweaked the references in the code.

Excel Formula:
=VSTACK(FILTER(CHOOSECOLS('Score Sheets'!D:G,1,2,-1),'Score Sheets'!D:D=D1),FILTER(CHOOSECOLS('Score Sheets'!T:W,1,2,-1),'Score Sheets'!T:T=D1))

Could you help me with including the date (column B) and then maintaining the data in order of date? I'd also need the Win/Loss included (Home would be Column H and Away would be Column X). I have included screenshots of what it looks like now and what I'd need it to look like.

Thank you again!
 

Attachments

  • Player.PNG
    Player.PNG
    6.4 KB · Views: 14
  • Player - Goal.PNG
    Player - Goal.PNG
    8.6 KB · Views: 15
Upvote 0
Your image shows the win/loss in columns G & W, not H & X
 
Upvote 0
So I got the VSTACK to work how I need except maintaining the data in order of date.

Excel Formula:
=VSTACK(FILTER(CHOOSECOLS('Score Sheets'!B:H,1,3,4,5,7),'Score Sheets'!D:D=D1),FILTER(CHOOSECOLS('Score Sheets'!B:X,1,19,20,21,23),'Score Sheets'!T:T=D1))
 
Upvote 0
I figured it out.

Here's the code:

Excel Formula:
=SORT(VSTACK(FILTER(CHOOSECOLS('Score Sheets'!B:H,1,3,4,5,7),'Score Sheets'!D:D=D1),FILTER(CHOOSECOLS('Score Sheets'!B:X,1,19,20,21,23),'Score Sheets'!T:T=D1)),,1,FALSE)

Thank you for your help, Fluff!
 
Upvote 0
Glad you sorted it & thanks for letting us know.
 
Upvote 0

Forum statistics

Threads
1,223,883
Messages
6,175,167
Members
452,615
Latest member
bogeys2birdies

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