Calculating combinations

Reboshua

Board Regular
Joined
Jan 23, 2015
Messages
88
I've recently started playing daily fantasy sports (DFS) and am curious how I can figure out some of the combinations of players using excel. For those unfamiliar with DFS, participants (me) pick a new team of players each day and compete with other participants (you) based on the performance of the players we select to be on our team. Using NBA as an example, I may pick LeBron James to be on my team and you might pick Kobe Bryant (you actually pick 9 players, but I'm simplifying.) Whoever scores more points that night will win the contest.

More details relevant to excel problem:

1. Each lineup I create must have 9 players on it, consisting of the following:

- 2 Point Guards (PG)
- 2 Shooting Guards (SG)
- 2 Small Forwards (SF)
- 2 Power Forwards (PF)
- 1 Center (C)

2. Each player has a salary/price associated with them for that day's contest.
3. I am constrained by a $60,000 salary cap each day.

So, you need to pick a lineup of players based on the structure described in #1, with the constraint of not going over the salary cap.

What I'm trying to use excel to figure out is the number of total combinations there might be for any given day. Tonight, for example, there are 370 players (see data below). Additionally, I'd like to be able to reduce the number of total combinations by introducing additional constraints on the problem based on other data I've collected. For example, I might want my minimum total salary spent to be $59,000 and I might want the minimum projected points for that evening (not shown below) to be 250, etc.

I know I can use solver to get at some of this, but I'm really interested in knowing the number of possible combinations when I introduce constraints.

PositionPlayerTeamSalary
PGRussell WestbrookOKC13200
PFAnthony DavisNOP12400
SFLeBron JamesCLE10900
CDeMarcus CousinsSAC10900
SFKevin DurantOKC10300
PGChris PaulLAC10200
PGStephen CurryGSW10000
PFLaMarcus AldridgePOR9600
PGJohn WallWAS9600
PFBlake GriffinLAC9300
CDeAndre JordanLAC9100
PFPau GasolCHI8900
SGJimmy ButlerCHI8600
PGKyrie IrvingCLE8500
SGDwyane WadeMIA8400
SGVictor OladipoORL8400
PGTyreke EvansNOP8300
SFRudy GaySAC8300
CHassan WhitesideMIA8200
PGDamian LillardPOR8200
PGKyle LowryTOR8200
SFKawhi LeonardSAS8200
CNikola VucevicORL8100
PGJrue HolidayNOP8000
CAl JeffersonCHA8000
PFSerge IbakaOKC8000
PFZach RandolphMEM7900
CMarc GasolMEM7900
PFPaul MillsapATL7800
PFKevin LoveCLE7700
SFDraymond GreenGSW7700
CAl HorfordATL7700
PFTim DuncanSAS7700
PGMichael Carter-WilliamsMIL7500
PGTy LawsonDEN7500
SGDeMar DeRozanTOR7400
PGIsaiah ThomasBOS7300
PFNerlens NoelPHI7300
SGKlay ThompsonGSW7200
SGGiannis AntetokounmpoMIL7200
PGMo WilliamsCHA7000
SGMonta EllisDAL7000
PFNikola MiroticCHI7000
PGGoran DragicMIA7000
PGAlexey ShvedNYK7000
PGElfrid PaytonORL6900
SFNicolas BatumPOR6900
CBrook LopezBRK6900
PFKenneth FariedDEN6900
PGKemba WalkerCHA6800
PGJeff TeagueATL6700
CEnes KanterOKC6700
CMarcin GortatWAS6700
CJoakim NoahCHI6700
SGJ.J. RedickLAC6600
SFTobias HarrisORL6500
SFDanilo GallinariDEN6400
PGTony ParkerSAS6400
SFKhris MiddletonMIL6400
SFChandler ParsonsDAL6400
PGGeorge HillIND6400
PGDarren CollisonSAC6300
PGMike ConleyMEM6300
SGWesley MatthewsPOR6200
SGRodney StuckeyIND6100
SGEric GordonNOP6000
CJonas ValanciunasTOR6000
SGAvery BradleyBOS6000
SGWill BartonDEN6000
PFDirk NowitzkiDAL6000
SFLuol DengMIA5900
PGRajon RondoDAL5900
PFAndrea BargnaniNYK5900
SFMichael Kidd-GilchristCHA5900
SGEvan TurnerBOS5900
PFThaddeus YoungBRK5800
PGDeron WilliamsBRK5800
SFDeMarre CarrollATL5800
SGBrad BealWAS5800
PGAaron BrooksCHI5800
SFWilson ChandlerDEN5700
PFDavid WestIND5700
SGDanny GreenSAS5700
PFBrandon BassBOS5700
CTyson ChandlerDAL5600
PGJarrett JackBRK5600
SGJ.R. SmithCLE5600
PGJameer NelsonDEN5500
PGIshmael SmithPHI5500
SGJamal CrawfordLAC5500
COmer AsikNOP5500
PFErsan IlyasovaMIL5400
SGJoe JohnsonBRK5400
SFGerald HendersonCHA5400
PGMarcus SmartBOS5400
SGKent BazemoreATL5300
SFRobert CovingtonPHI5300
PFRyan AndersonNOP5300
PGD.J. AugustinOKC5200
PGDennis SchroderATL5200
SFAndre IguodalaGSW5200
CZaza PachuliaMIL5200
SFMatt BarnesLAC5200
SFJae CrowderBOS5100
CSteven AdamsOKC5100
CRoy HibbertIND5100
PGRay McCallumSAC5000
CAndrew BogutGSW5000
SFJeff GreenMEM5000
PGLangston GallowayNYK5000
CTimofey MozgovCLE4900
CRobin LopezPOR4900
SFLuc Richard Mbah a MoutePHI4900
PGNate RobinsonLAC4800
PGIsaiah CanaanPHI4800
PFTaj GibsonCHI4800
CTyler ZellerBOS4800
SFPaul PierceWAS4800
CJusuf NurkicDEN4800
SGLouis WilliamsTOR4800
PGJose CalderonNYK4700
SGTony AllenMEM4700
PFCody ZellerCHA4700
PFJohn HensonMIL4700
CAlexis AjincaNOP4700
SGRandy FoyeDEN4600
SFAl-Farouq AminuDAL4600
PGMario ChalmersMIA4600
PFAmir JohnsonTOR4600
PFLuis ScolaIND4600
PFNene HilarioWAS4600
SGKyle KorverATL4600
SGO.J. MayoMIL4500
SFC.J. MilesIND4500
PFThomas RobinsonPHI4500
CAnderson VarejaoCLE4500
PFLouis AmundsonNYK4500
PFDavid LeeGSW4500
PFTristan ThompsonCLE4500
CCole AldrichNYK4400
SFJustin HolidayGSW4400
CMason PlumleeBRK4400
CKelly OlynykBOS4400
PGAndre MillerSAC4400
SGManu GinobiliSAS4400
PGJerryd BaylessMIL4300
PFPatrick PattersonTOR4300
SFHarrison BarnesGSW4300
SGTim Hardaway Jr.NYK4300
SGDion WaitersOKC4300
PFJason ThompsonSAC4300
SGAnthony MorrowOKC4300
SGJason RichardsonPHI4300
PGDevin HarrisDAL4300
PFAmar'e StoudemireDAL4200
CTiago SplitterSAS4200
SFMike DunleavyCHI4200
SGArron AfflaloPOR4200
PFMarvin WilliamsCHA4200
SGHenry WalkerMIA4200
SGTony SnellCHI4200
PGC.J. WatsonIND4200
PGShaun LivingstonGSW4200
PFDante CunninghamNOP4100
SFQuincy PondexterNOP4100
CChris KamanPOR4100
SFSolomon HillIND4100
SFHollis ThompsonPHI4100
SGIman ShumpertCLE4100
PFJ.J. HicksonDEN4100
PFKris HumphriesWAS4100
SGBen McLemoreSAC4100
CBismack BiyomboCHA4000
PGGreivis VasquezTOR4000
SGEvan FournierORL4000
PFBoris DiawSAS4000
SGLance StephensonCHA4000
SGTyler JohnsonMIA4000
PFJason SmithNYK4000
PGNorris ColeNOP4000
CChris AndersenMIA3900
PGJose Juan BareaDAL3900
PGBeno UdrihMEM3900
SFMaurice HarklessORL3800
SFJared DudleyMIL3800
PFJarnell StokesMEM3800
CSpencer HawesLAC3800
PGShelvin MackATL3800
PFDrew GoodenWAS3800
PFMike ScottATL3700
SFMichael BeasleyMIA3700
CSamuel DalembertNYK3700
PFMarreese SpeightsGSW3700
PFChanning FryeORL3700
SFHedo TurkogluLAC3700
SFBojan BogdanovicBRK3700
SFOmri CasspiSAC3700
SGMarkel BrownBRK3700
SGCourtney LeeMEM3700
CDewayne DedmonORL3700
CMiles PlumleeMIL3600
SFLance ThomasNYK3600
PGShane LarkinNYK3600
PFReggie EvansSAC3600
CIan MahinmiIND3600
SGLeandro BarbosaGSW3600
SFVince CarterMEM3600
PGNick CalathesMEM3600
SFAustin DayeATL3600
PFKenyon MartinMIL3600
PFCharlie VillanuevaDAL3600
SFJames JohnsonTOR3600
PFJerami GrantPHI3600
PGTyler EnnisMIL3600
SGMarco BelinelliSAS3600
CFestus EzeliGSW3500
CAron BaynesSAS3500
SGSergey KarasevBRK3500
CLucas NogueiraTOR3500
SFJeffery TaylorCHA3500
SGJarell EddieATL3500
SFCleanthony EarlyNYK3500
SGGary HarrisDEN3500
SGRicky LedoNYK3500
SGNemanja NedovicGSW3500
SGJoe HarrisCLE3500
SGJohn JenkinsATL3500
SFLuigi DatomeBOS3500
PFDwight PowellDAL3500
SFJames YoungBOS3500
SFBruno CabocloTOR3500
PFJakarr SampsonPHI3500
SGZoran DragicMIA3500
SFDamjan RudezIND3500
PFNoah VonlehCHA3500
PFAaron GordonORL3500
PFTravis WearNYK3500
PGGal MekelNOP3500
SGErick GreenDEN3500
PGLarry Drew IIPHI3500
CPero AnticATL3500
PFJoffrey LauvergneDEN3500
PGKalin LucasMEM3500
SGAlan AndersonBRK3500
PGToure' MurryWAS3500
CShayne WhittingtonIND3500
COgnjen KuzmicGSW3500
PFCameron BairstowCHI3500
SFVictor ClaverDEN3500
PFFurkan AldemirPHI3500
PGTroy DanielsCHA3500
PGNate WoltersNOP3500
SGC.J. McCollumPOR3500
SFDoug McDermottCHI3500
PGWill CherryCLE3500
CAlex KirkNYK3500
PFMike MuscalaATL3500
PGMatthew DellavedovaCLE3500
CJoel FreelandPOR3500
SFChris CopelandIND3500
PFMalcolm ThomasPHI3500
PFGreg SmithDAL3500
PFMitch McGaryOKC3500
SFGlenn Robinson IIIPHI3500
PGDavid StocktonSAC3500
SGC.J. WilcoxLAC3500
SGNik StauskasSAC3500
PFAndrew NicholsonORL3500
PGBrian RobertsCHA3500
SGJordan AdamsMEM3500
SFDrew GordonPHI3500
SFJames EnnisMIA3500
PFKyle O'QuinnORL3500
SFRonald Roberts, Jr.PHI3500
SFKyle AndersonSAS3500
SFTerrence RossTOR3500
PFKevin SeraphinWAS3500
SFMartell WebsterWAS3500
SFRichard JeffersonDAL3500
CMatt BonnerSAS3500
SFAndrei KirilenkoPHI3500
PGSteve BlakePOR3500
PFElton BrandATL3500
SFChris Douglas-RobertsBOS3500
SGThabo SefoloshaATL3500
PFNick CollisonOKC3500
SGWillie GreenORL3500
CKosta KoufosMEM3500
SFMike MillerCLE3500
CNazr MohammedCHI3500
SFSteve NovakOKC3500
PGPatrick MillsSAS3500
PFJeff AyresSAS3500
SFJames JonesCLE3500
SFDorell WrightPOR3500
CJaVale McGeePHI3500
CBrendan HaywoodCLE3500
PGToney DouglasNOP3500
PGA.J. PriceCLE3500
CRyan HollinsSAC3500
PGRamon SessionsWAS3500
PFTyrus ThomasMEM3500
SFShawn MarionCLE3500
SGBen GordonORL3500
CJason MaxiellCHA3500
PGKirk HinrichCHI3500
PGJannero PargoCHA3500
PFGlen DavisLAC3500
CKendrick PerkinsCLE3500
PGRaymond FeltonDAL3500
SFGerald WallaceBOS3500
CRonny TuriafPHI3500
PFCarl LandrySAC3500
PFDarrell ArthurDEN3500
PFUdonis HaslemMIA3500
PFShavlik RandolphBOS3500
PGLuke RidnourORL3500
SFRasual ButlerWAS3500
PFTyler HansbroughTOR3500
CChuck HayesTOR3500
SGDahntay JonesLAC3500
SGBrandon RushGSW3500
CDeJuan BlairWAS3500
PFJonas JerebkoBOS3500
SGAndre DawkinsBOS3500
SGAustin RiversLAC3500
CPatric YoungNOP3500
CBernard JamesDAL3500
PGShabazz NapierMIA3500
SFJeremy LambOKC3500
SFPerry Jones IIIOKC3500
SGAllen CrabbePOR3500
PGJorge GutierrezMIL3500
SGAndre RobersonOKC3500
SFOtto PorterWAS3500
CHenry SimsPHI3500
CJohnny O'BryantMIL3500
PGPhil (Flip) PresseyBOS3500
SGP.J. HairstonCHA3500
PFJames Michael McAdooGSW3500
PGRuss SmithMEM3500
SGDarius MillerNOP3500
CMeyers LeonardPOR3500
SGRoy Devyn MarbleORL3500
CJeff WitheyNOP3500
PFCory JeffersonBRK3500
SFQuincy AcyNYK3500
SGElliot WilliamsNOP3500
SFLandry FieldsTOR3500
CJerome JordanBRK3500
PGDonald SloanIND3500
SFLuke BabbittNOP3500
CEkpe UdohLAC3500
PGGarrett TempleWAS3500
SGReggie WilliamsSAS3500
SFAlonzo GeePOR3500
CGreg StiemsmaTOR3500
PFDerrick WilliamsSAC3500
PGJimmer FredetteNOP3500
SGMalcolm LeePHI3500
CLavoy AllenIND3500
PGE'Twaun MooreCHI3500
SFJaMychal GreenMEM3500
PGDarius MorrisBRK3500
PFJon LeuerMEM3500
SFJordan HamiltonLAC3500
PGCory JosephSAS3500
SFKyle SinglerOKC3500
SGJared CunninghamPHI3500

<tbody>
</tbody>
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I think you will find the number of combinations too large to work with. For example if you eliminate all with a salary of 3700 and below, without a spending cap you have
12,061,815,296 combinations

<tbody>
</tbody>
 
Upvote 0
Thanks West Man. I've definitely run the combos possible unconstrained. But I think interjecting constraints like salary cap, like the fact that you have to choose 2 from each position (1 from center) all reduce the combinations greatly. When you interject even MORE constraints like a MIN salary value for the whole team, it becomes even more interesting.

My question is... how do I do this in excel?
 
Upvote 0
The 12 billion combinations includes choosing 1 center and 2 for each of the other positions as well as eliminating any players with a salary of $3700 or less. So that doesn't reduce the total combinations to, in my opinion, a workable number. I worked it by eliminating the lower valued players and then counting (using countif) how many were left for each position. For instance for SG if you have 38 players, the combinations 2 SGs is COMBIN(38,2). The total combinations is simply the product of the combinations for each of the 5 positions.

Introducing a team constraint would require VBA programming, something for which I have very limited skills
 
Upvote 0
Introducing a team constraint would require VBA programming, something for which I have very limited skills

Thanks again for the reply. Yep, this constraint is by far the most important. I'm not sure eliminating those at $3700 or less is meaningful to the problem as there are plenty of times when you'll roster someone at that price level. The trick is in limiting the total team salary to less than $60,000 for sure, and ideally between $58,000 and $60,000. Once that constraint is introduced, I'm guessing the combos reduce significantly.
 
Upvote 0
Well, just for my own amusement, I divided the players by position then randomized their order and wrote a VBA sub to check to see how many teams would fall into the 58,000 to 60,000 range. Running the full combinations might take days, but in testing 20 million combinations I found that 57,205 fell into the test group. So it appears that approximately 0.286% would fall into the range of 58000 - 60000. So you would still have approx.
1.40864E+13 combinations to work with.

<tbody>
</tbody>
 
Upvote 0
That's incredibly nice of you to do that, because I have no idea how to do it. I grant you the numbers are high when just factoring in salary, but the value here is in introducing other factors like minutes, projected score, etc. All of these things help deliver better accuracy and a lower mean square error for prediction. I just need to learn how to do this myself.
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,860
Members
449,194
Latest member
HellScout

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