Hi Eric,Awesome,I have similar query, I need urgent solution and code for the below problem statement??? Thanks in Advance
[TABLE="class: waffle no-grid"]
<thead>[TR]
[TH="class: row-header freezebar-origin-ltr"][/TH]
[TH="class: column-headers-background"]A[/TH]
[TH="class: column-headers-background"]B[/TH]
[TH="class: column-headers-background"]C[/TH]
[TH="class: column-headers-background"]D[/TH]
[TH="class: column-headers-background"]E[/TH]
[TH="class: column-headers-background"]F[/TH]
[TH="class: column-headers-background"]G[/TH]
[TH="class: column-headers-background"]H[/TH]
[TH="class: column-headers-background"]I[/TH]
[TH="class: column-headers-background"]J[/TH]
[TH="class: column-headers-background"]K[/TH]
[TH="class: column-headers-background"]L[/TH]
[TH="class: column-headers-background"]M[/TH]
[/TR]
</thead><tbody>[TR]
[TH="class: row-headers-background"]1
[/TH]
[TD="class: s0 softmerge, bgcolor: #C9DAF8"]Background
[/TD]
[TD="class: s1, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]2
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- We are trying to automate the team selection process for different states for Ranji Tournament
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]3
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- The selection process involves using Player Statistics and some inputs to determine the ideal team composition for different states
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]4
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- This assignment will allow you to use excel automation to select cricket players for different states for Ranji trophy.
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]5
[/TH]
[TD="class: s7"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]6
[/TH]
[TD="class: s0 softmerge, bgcolor: #C9DAF8"]Problem Statement
[/TD]
[TD="class: s1, bgcolor: #C9DAF8"][/TD]
[TD="class: s1, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]7
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]We need to select the best team for
EACH STATE
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s9"][/TD]
[TD="class: s9"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]8
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]Given a set of player information, some selection criteria and the required number of players at each position as input,automatically mark whether a player is selected or not for his state team
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]9
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]The worksheet should automatically handle the following changes:
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s9"][/TD]
[TD="class: s9"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]10
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- Changes in team composition (Number of Batsman, Number of Bowlers and Number of All Rounders)
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]11
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- Addition of more states in the dataset
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s9"][/TD]
[TD="class: s9"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]12
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- Changes in the data set (Batting Averages / Wickets and Wicketkeeper flag)
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]13
[/TH]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]14
[/TH]
[TD="class: s0 softmerge, bgcolor: #C9DAF8"]Data Available:
[/TD]
[TD="class: s1, bgcolor: #C9DAF8"][/TD]
[TD="class: s1, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]15
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]1) Player Info: Each player's info is given in the Player_Statistics sheet and contains following details:
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]16
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- Player Name
[/TD]
[TD="class: s6"][/TD]
[TD="class: s9"][/TD]
[TD="class: s9"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]17
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"]- State[/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]18
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- Position (Batsman/ Bowler/ Allrounder)
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s9"][/TD]
[TD="class: s9"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]19
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- Batting Average
[/TD]
[TD="class: s6"][/TD]
[TD="class: s9"][/TD]
[TD="class: s9"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]20
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- Bowling Average (Wickets/ Match)
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s9"][/TD]
[TD="class: s9"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]21
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- isWicketkeeper
[/TD]
[TD="class: s6"][/TD]
[TD="class: s9"][/TD]
[TD="class: s9"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]22
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]23
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]2) Required Team Composition:
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s9"][/TD]
[TD="class: s9"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]24
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- The required number of players at each position (batsman, bowler or allrounder)
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]25
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- Please refer to Required_Team_Composition sheet
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s9"][/TD]
[TD="class: s9"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]26
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]27
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]3) Selection Criteria:
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s9"][/TD]
[TD="class: s9"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]28
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- There has to be one wicketkeeper-batsman in the team. In case there are multiple candidate wicketkeepers in the state, the one with highest batting average is selected
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]29
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- Select the remaining number of required batsmen in a decreasing order of their batting averages
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]30
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- Select the required number of bowlers in the decreasing order of wickets/match
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]31
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- Select the allrounders based on the formula (Batting average + 5*wickets/match). The higher this value, the better the allrounder and needs to be chosen
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]32
[/TH]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]33
[/TH]
[TD="class: s0 softmerge, bgcolor: #C9DAF8"]Output Required:
[/TD]
[TD="class: s1, bgcolor: #C9DAF8"][/TD]
[TD="class: s1, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]34
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]1) The "isSelected" flag should have an output "True/ False" for each row in "Player_statistics" sheet indicating whether a player is selected based on the criteria or not.
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]35
[/TH]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]36
[/TH]
[TD="class: s0 softmerge, bgcolor: #C9DAF8"]Process & Instructions:
[/TD]
[TD="class: s1, bgcolor: #C9DAF8"][/TD]
[TD="class: s1, bgcolor: #C9DAF8"][/TD]
[TD="class: s1, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]37
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4, colspan: 12"]1) To get the selected players, you should write excel formulas or VBA macros which populate the value of isSelected[/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]38
[/TH]
[TD="class: s4"][/TD]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]- If needed, you can add columns to the right of isSelected which would help you in the processing
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]39
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"]2) The submitted solution should be generic so that it should work on changing the Player Info and the required team composition
[/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]40
[/TH]
[TD="class: s4"][/TD]
[TD="class: s5 softmerge"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[TD="class: s6"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]41
[/TH]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[TD="class: s8"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]
[/TH]
[TD="class: s0 softmerge, bgcolor: #C9DAF8"][/TD]
[TD="class: s1, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s2, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[TD="class: s3, bgcolor: #C9DAF8"][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: waffle"]
<thead>[TR]
[TH="class: row-header freezebar-origin-ltr"][/TH]
[TH="class: column-headers-background"]A[/TH]
[TH="class: column-headers-background"]B[/TH]
[TH="class: column-headers-background"]C[/TH]
[TH="class: column-headers-background"]D[/TH]
[TH="class: column-headers-background"]E[/TH]
[TH="class: column-headers-background"]F[/TH]
[TH="class: column-headers-background"]G[/TH]
[/TR]
</thead><tbody>[TR]
[TH="class: row-headers-background"]1
[/TH]
[TD="class: s0"]Player Name[/TD]
[TD="class: s0"]State[/TD]
[TD="class: s0"]Position[/TD]
[TD="class: s0 softmerge"]Batting Average
[/TD]
[TD="class: s0 softmerge"]Wickets / Match
[/TD]
[TD="class: s0 softmerge"]IsWicketKeeper
[/TD]
[TD="class: s1"]IsSelected[/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]2
[/TH]
[TD="class: s2"]P1[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]24[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]3
[/TH]
[TD="class: s2"]P2[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]11[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]4
[/TH]
[TD="class: s2"]P3[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]17[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]5
[/TH]
[TD="class: s2"]P4[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]45[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]6
[/TH]
[TD="class: s2"]P5[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]22[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]7
[/TH]
[TD="class: s2"]P6[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]16[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]8
[/TH]
[TD="class: s2"]P7[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]20[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]9
[/TH]
[TD="class: s2"]P8[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]16[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]10
[/TH]
[TD="class: s2"]P9[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]15[/TD]
[TD="class: s3"]4[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]11
[/TH]
[TD="class: s2"]P10[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]24[/TD]
[TD="class: s3"]4[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]12
[/TH]
[TD="class: s2"]P11[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]18[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]13
[/TH]
[TD="class: s2"]P12[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]5[/TD]
[TD="class: s3"]4[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]14
[/TH]
[TD="class: s2"]P13[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]9[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]15
[/TH]
[TD="class: s2"]P14[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]21[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]16
[/TH]
[TD="class: s2"]P15[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]24[/TD]
[TD="class: s3"]4[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]17
[/TH]
[TD="class: s2"]P16[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]33[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]18
[/TH]
[TD="class: s2"]P17[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]31[/TD]
[TD="class: s3"]4[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]19
[/TH]
[TD="class: s2"]P18[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]20[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]20
[/TH]
[TD="class: s2"]P19[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]17[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]21
[/TH]
[TD="class: s2"]P20[/TD]
[TD="class: s2"]Maharashtra[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]11[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]22
[/TH]
[TD="class: s2"]P21[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]29[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]23
[/TH]
[TD="class: s2"]P22[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]46[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]24
[/TH]
[TD="class: s2"]P23[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]16[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]25
[/TH]
[TD="class: s2"]P24[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]34[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]26
[/TH]
[TD="class: s2"]P25[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]49[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]27
[/TH]
[TD="class: s2"]P26[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]30[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]28
[/TH]
[TD="class: s2"]P27[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]19[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]29
[/TH]
[TD="class: s2"]P28[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]8[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]30
[/TH]
[TD="class: s2"]P29[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]10[/TD]
[TD="class: s3"]4[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]31
[/TH]
[TD="class: s2"]P30[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]8[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]32
[/TH]
[TD="class: s2"]P31[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]11[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]33
[/TH]
[TD="class: s2"]P32[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]18[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]34
[/TH]
[TD="class: s2"]P33[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]19[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]35
[/TH]
[TD="class: s2"]P34[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]11[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]36
[/TH]
[TD="class: s2"]P35[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]39[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]37
[/TH]
[TD="class: s2"]P36[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]47[/TD]
[TD="class: s3"]4[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]38
[/TH]
[TD="class: s2"]P37[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]34[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]39
[/TH]
[TD="class: s2"]P38[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]44[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]40
[/TH]
[TD="class: s2"]P39[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]33[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]41
[/TH]
[TD="class: s2"]P40[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]24[/TD]
[TD="class: s3"]4[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]42
[/TH]
[TD="class: s2"]P41[/TD]
[TD="class: s2"]Karnataka[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]20[/TD]
[TD="class: s3"]4[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]43
[/TH]
[TD="class: s2"]P42[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]17[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]44
[/TH]
[TD="class: s2"]P43[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]24[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]45
[/TH]
[TD="class: s2"]P44[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]17[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]46
[/TH]
[TD="class: s2"]P45[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]33[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]47
[/TH]
[TD="class: s2"]P46[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]31[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]48
[/TH]
[TD="class: s2"]P47[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]33[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]49
[/TH]
[TD="class: s2"]P48[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]19[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]50
[/TH]
[TD="class: s2"]P49[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]19[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]51
[/TH]
[TD="class: s2"]P50[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]21[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]52
[/TH]
[TD="class: s2"]P51[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]17[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]53
[/TH]
[TD="class: s2"]P52[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]13[/TD]
[TD="class: s3"]4[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]54
[/TH]
[TD="class: s2"]P53[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]17[/TD]
[TD="class: s3"]4[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]55
[/TH]
[TD="class: s2"]P54[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]13[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]56
[/TH]
[TD="class: s2"]P55[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]21[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]57
[/TH]
[TD="class: s2"]P56[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]32[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]58
[/TH]
[TD="class: s2"]P57[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]28[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]59
[/TH]
[TD="class: s2"]P58[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]17[/TD]
[TD="class: s3"]3[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]60
[/TH]
[TD="class: s2"]P59[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]34[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]61
[/TH]
[TD="class: s2"]P60[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]44[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]62
[/TH]
[TD="class: s2"]P61[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]All Rounder[/TD]
[TD="class: s3"]28[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]63
[/TH]
[TD="class: s2"]P62[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Batsman[/TD]
[TD="class: s3"]26[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s3"]1[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]64
[/TH]
[TD="class: s2"]P63[/TD]
[TD="class: s2"]Delhi[/TD]
[TD="class: s2"]Bowler[/TD]
[TD="class: s3"]21[/TD]
[TD="class: s3"]2[/TD]
[TD="class: s3"]0
[TABLE="class: waffle"]
<thead>[TR]
[TH="class: row-header freezebar-origin-ltr"][/TH]
[TH="class: column-headers-background"]A[/TH]
[TH="class: column-headers-background"]B[/TH]
[/TR]
</thead><tbody>[TR]
[TH="class: row-headers-background"]1
[/TH]
[TD="class: s0"][/TD]
[TD="class: s0"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]2
[/TH]
[TD="class: s1 softmerge"]Per Team Composition
[/TD]
[TD="class: s2"][/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]3
[/TH]
[TD="class: s3"]Batsman[/TD]
[TD="class: s4"]4[/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]4
[/TH]
[TD="class: s3"]Bowler[/TD]
[TD="class: s4"]3[/TD]
[/TR]
[TR]
[TH="class: row-headers-background"]5
[/TH]
[TD="class: s3"]All Rounder[/TD]
[TD="class: s4"]4
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="class: s2"]
[/TD]
[/TR]
</tbody>[/TABLE]
I just noticed that I missed your request that the teams be sorted in descending order of rating. Here's a version that includes that. I also made a few other tweaks to it, mostly adding some extra error checking and improving the sort.
Code:
Sub MakeTeams()
Dim Players(200, 3), TeamSize(10) As Integer, TeamRating(10) As Double
Dim i As Integer, r As Integer, j As Integer, c As Integer, ctr As Integer
Dim NumPlayers As Integer, NumTeams As Integer, trials As Integer
Dim t As Integer, tc As Integer, MaxRating As Double, MinRating As Double
' Written by Eric W. 1/9/2016
' How many teams?
NumTeams = Range("D2").Value
If NumTeams > 10 Or NumTeams < 2 Or Int(NumTeams) <> NumTeams Then
MsgBox "The number of teams must be an integer from 2-10."
Exit Sub
End If
' Read all the players and ratings
r = 2
Erase Players, TeamSize, TeamRating
While Cells(r, "A") <> ""
If r > 201 Then
MsgBox "The number of players must be under 200."
Exit Sub
End If
Players(r - 1, 1) = Cells(r, "A")
Players(r - 1, 2) = Cells(r, "B")
If Not IsNumeric(Players(r - 1, 2)) Then
MsgBox "One of the ratings is not a number."
Exit Sub
End If
r = r + 1
Wend
NumPlayers = r - 2
' Figure out the team sizes
If NumTeams > NumPlayers Then
MsgBox "You must have at least 1 player per team. Make sure there are no gaps in the player list."
Exit Sub
End If
For r = 1 To NumTeams
TeamSize(r) = Int(NumPlayers / NumTeams) + IIf(r <= (NumPlayers Mod NumTeams), 1, 0)
Next r
' Make random teams
trials = 0
While trials < 250
Call Shuffle(Players, NumPlayers)
' Figure out the team ratings
t = 1
tc = 1
Erase TeamRating
MaxRating = -1
MinRating = 11
For i = 1 To NumPlayers
TeamRating(t) = TeamRating(t) + Players(i, 2)
tc = tc + 1
If tc > TeamSize(t) Then
TeamRating(t) = TeamRating(t) / TeamSize(t)
If TeamRating(t) > MaxRating Then MaxRating = TeamRating(t)
If TeamRating(t) < MinRating Then MinRating = TeamRating(t)
t = t + 1
tc = 1
End If
Next i
' Max team rating - min team rating within the limit?
If MaxRating - MinRating <= Cells(2, "F") Then GoTo PrintTeams
' Nope, try again
trials = trials + 1
Wend
MyText = "Unable to find a valid set of teams in 250 tries." & Chr(10) & Chr(10)
MyText = MyText & "You may try again, or try again with a higher MaxRatingDiff."
MsgBox MyText
Exit Sub
' Print the teams
PrintTeams:
Range("I1:AP100").ClearContents
ctr = 1
For i = 1 To NumTeams
c = i * 3 + 6
Cells(1, c) = "Team " & Chr(64 + i)
For j = 1 To TeamSize(i)
Cells(j + 1, c) = Players(ctr, 1)
Cells(j + 1, c + 1) = Players(ctr, 2)
ctr = ctr + 1
Next j
With ActiveSheet.Sort
.SortFields.Clear
.SortFields.Add Key:=Cells(2, c + 1), Order:=xlDescending
.SetRange Range(Cells(2, c), Cells(TeamSize(1) + 1, c + 1))
.Apply
End With
Cells(TeamSize(1) + 3, c + 1) = TeamRating(i)
Next i
End Sub
' This team will randomly shuffle the players
' (It's really a bad sort, but with under 100 players, it should be good enough.)
Sub Shuffle(ByRef Players, ByVal NumPlayers)
' Assign a random number to each player
For i = 1 To NumPlayers
Players(i, 3) = Rnd()
Next i
' Now sort by the random numbers
For i = 1 To NumPlayers
For j = 1 To NumPlayers - i
If Players(j, 3) > Players(j + 1, 3) Then
a = Players(j, 1)
b = Players(j, 2)
c = Players(j, 3)
Players(j, 1) = Players(j + 1, 1)
Players(j, 2) = Players(j + 1, 2)
Players(j, 3) = Players(j + 1, 3)
Players(j + 1, 1) = a
Players(j + 1, 2) = b
Players(j + 1, 3) = c
End If
Next j
Next i
End Sub