Creating a ramdom baseball batting order in excel - excel

I am trying to build a baseball spreadsheet for my little league team. I have 10 players and 15 games. I am trying to figure out a way to populate the batting order where everyone gets an equal numbers of games batting 1-10 in the order.
Does anyone know of an easy way to do this?

As mentioned in the comments, it's impossible to evenly distribute 10 players in 10 batting order positions over 15 games. It's similar to trying to divide 15 by 10 evenly. So you'll have to get creative on how to handle the five remaining games (fundraiser?)
Random but Fair For Ten Games
In answer to your question of creating a random batting order, you'd probably only want to randomize once, and then offset the order by 1 position each game. This will get you each player in one position in for ten games.
Random Each Game
If you truly wanted random each game, you'd probably have some undesirable distribution with some kids getting to bet first multiple times while others never get a turn (hazards of truly random).
I built out a quick spreadsheet on google sheets here that you can see how such a tool could work. If you download and hit delete in a blank cell it will re-randomize the sheet. It's using the functions index and Rank and Rand.
Good luck.

Related

Calculating number of times one "team" beats another in Excel

(I use the term "teams" generically here because the entirety of this question rests on ranking, and it seemed to be the most intuitive language to describe my problem.)
In a league of 30 teams, each day only 8 teams play. The results for those teams are ranked ordinally from 1 to 8 for the day. This continues "forever", so that additional results must be recorded every day.
Example after 4 days:
I want to calculate a single number to describe the relationship between two teams. For instance, given the example, the value (in a 2d table) that describes the relationship of Ace to Get is 1. Ace beat Get twice and Get beat Ace once (2-1).
I have been messing with Sumproduct, Match, and Index to get get values, which I could calculate using many extra tables, but I may need to add "teams" on the fly, and I do not know how large the pool of teams will become. Because of this, I was hoping to be able to use a single formula in the 2d relationship table. The results of that table, looking at just day 1 and day 2 given the previous example, are:
Is there a direct formula I can use to calculate the results to populate that table?
You can try following formula:
=IF($A11<>B$10;
SUMPRODUCT(
IF(MMULT(($B$1:$I$1)*($B$2:$I$3=$A11);ROW($1:$8)^0)
<MMULT(($B$1:$I$1)*($B$2:$I$3=B$10);ROW($1:$8)^0);
1;
-1)
*(((MMULT(--($B$2:$I$3<>$A11);ROW($1:$8)^0)=8)
+(MMULT(--($B$2:$I$3<>B$10);ROW($1:$8)^0)=8))
=0));
"")
Copy right and down.

Generate permutations

I have n players to assign to n games. 10 <= n <= 20. Each player can sign up for up to 3 games but will only get one. Different players have different score for each game they sign up for.
Example with 10 players:
It's always possible to assign players x to game x but it will not always give the highest score in total.
My goal is to get as high score as possible and I therefore want to test the different permutations. I could teoretically test all permutations and throw away the unfeasible ones but it will give me a hughe number of possibilities (n!).
Is it possible to reduce the problem with the sign up limit of max 3 games? Maybe this can be done more easily than my approach? Any thoughts?
I'm working in Excel VBA.
I hope you find this as interesting as I do ...
Sorry if you find this unclear! My question is if it's possible to generate a subset of all the permutations. More precise only the feasible ones (which are the ones without any zero score).
Well, just set this up in the solver using Linear Programming as you can see in the image. Have shown the formulae so you can build it as well, along with the solver settings.
Won't give the permutations, but does solve for the highest combination.
Edit, updated image... it now shows correct ranges for the calculations, after trying to make it fit a reasonable size...

Displaying multiple items in Excel graph and few calculation issues

I've done some Googling for each of my issues but haven't found exactly the results as I wanted. Things I need to be done doesn’t probably include any macros/VBA skills, just basic knowledge of Excel.
Now to my spreadsheet. I'm a Dota 2 player and I like statistics. I like it that much that I'd like to keep track of my achievements and results. Only problem is that the game tracker sucks and to get great information in web you have to pay for it, so I decided it's time for me to create my own spreadsheet to track my skills.
I don't know which place is the best to share my spreadsheet but I uploaded it to Estonian uploading host, link is here. I will also provide with pictures so you don't have to download anything.
This is what it looks like in general:
Problem number 1: The left table, or column has 1000 rows. In web design it's possible to make elements fixed depending on the scroll, I'd like to use similar feature here. If the table gets scrolled down, the right table (area with games, bonus and graph) will get scrolled down with it.
Problem number 2: Average MMR. I'd like to show average MMR after each entry depending on the first entries. Right now there's avg MMR for J4:J8. The calculation for J8 looks like this: =AVERAGE(C4:C8). For J7 it looks like this: =AVERAGE(C4:C7). I'd like to do this for all my 1000 rows, but I don't want to type it out. If I try to drag down from the corner, it will continue with C5:C8, C6:C9 etc (so it changes the starting point)
Problem number 3: Under longestGame there's currently Date and Hero. This should show the Date and Hero of which the longest game occurred. I tried to do this with LOOKUP function but it required table to be in ascending order, which I don't want. For current, 44,22, there should be Storm Spirit and 14.06.2015.
Problem number 4: Graph. I'd like to display three series on graph - MMR, average MMR and game length (time). The problem is, that MMR and average MMR will be in the numbers on 3000-7000 but the game length will only be probably in timeframe 20:00-120:00. Maybe it's possible to add two sets of values to the Y axis or maybe set Time series maximum 200:00 and minimum 0:00 and create graph according to this. I'm really stupid making graphs and I haven't figured out a clever way yet.
Problem number 5: Graph again. Right now I have to set the series for the graph. I've currently set it to C4:C54 (so 50 rows). I'd like it to move around a bit and by that I mean that if there happens to be C55-th game then the graph would start from C5:C55 and move along (so it'll count 50 last games).
I'm in a benevolent mood so rather than downvoting your question, because it is not really suitable for this forum I'm going to give you some hints and guidance. The numbers below correspond to the problems in your question.
Excel permits more than one window to be used on the same workbook -
so one window can show the data and one the summary.
Find out about absolute and relative cell addressing - its a valuable bit of knowledge for anyone serious about Excel and it will be of use in solving your problem.
Find out about the MATCH function. You can use this to find out which row of your table contains the longest game, shortest game, max MMR, min MMR by matching an element from the summary on the right (cols M onward) against the appropriate column table on the left. The find out about the INDEX function - this can be used to pull the values in the columns for Hero and Date which correspond to a specific row (such as the row containing the longest game, shortest game, etc). Search INDEX MATCH and find out why using these two functions in combination is often preferred to using the VLOOKUP function
Persevere - there are graph options available to do what you want and the only way to really learn is to go through the pain of trying them out, failing and working at it until you succeed.
Set up an area of worksheet to hold the 50*3 table of data for your graphs. Find out about the COUNT function and think how it might be of use in determining which rows of the data table map to the 50 rows of graph data. Then think about how to populate the graph data table using one of the functions mentioned above. Incidentally, C4:C54 is actually 51 rows, not 50.

Grab next same value in Excel/Google Sheets for RANK/MATCH formula

I have a list of players in Google Sheets that assigns them a rank based on wins, followed by some more match variables — standard stuff.
I then use the rank to order the players in a league table format.
However, when I have two more players with the same rank, I hit a problem. The easiest way to illustrate it is with a link to the spreadsheet. Left side is the data, right side is the outputted table:
https://docs.google.com/spreadsheets/d/1n05ETFfF01uCwp1Q88Z0Zi8XkH-dNm29Ocb6yVP84rU/edit?usp=sharing
My aim is:
To allow drawing players, and thus output:
1= Player 1
1= Player 2
3 Player 3
4 Player 4
But also to add players with a rank of 0 (already calculated) to the bottom of the list, in no particular order, but below those who have played.
May serve for ColumnM, but seems would require adjustments elsewhere:
=if(countif(I$2:I$8,I2)>1,IF((B2=0), 0, RANK(H2,$H$1:$H$531,0))&"=",IF((B2=0), 0, RANK(H2,$H$1:$H$531,0)))
You could reproduce your table (excluding the ranking) with this in N1:
=QUERY(A:G,"select * order by B desc, G desc",1)
and then in M2:
=ArrayFormula(IF(LEN(N2:N),(COUNTIF(S2:S,">"&S2:S)+1)&IF(COUNTIF(S2:S,S2:S)>1,"=",),))
Any kind of algorithm is going to hate ties. They will produce unpredictable results, logic errors.
So you might set up your ranking system to remove the ties. Possibly use the date they joined the league for tiebreaker, which would allow you to rank the players with no stats as well.
Make the rules known to all players. E.g. 3 points for a win, 1 point for a tie, 0 for a loss, tie goes to the player with highest total points scored. If still tied, it goes to player in the league longer. The likelihood of established players getting to the join-date tiebreaker should be as remote as you can make it, so your first tiebreaker should be one that produces a lot of diverse answers.
Also, I am not sure, but I think the reason your question got downvoted was because a) it's a bit vague, and b) in this day and age, you really don't want to be opening data files from unknown people. A snapshot of data from your spreadsheet might have been a better illustration than a link to it. I know I will not open your sheet...I don't know you.

1X2 formula using IF & AND nesting in Open Office Calc for football world cup?

It is FIFA world cup time and need some help with my spread sheet project.
We have betting of every game result. Every guy/grl in our betting pool gets points as followed:
1 point for guessing home score right
1 point for guessing away score right
1 point for guessinf winner (1X2) right.
Every guy/grl has his/her own tab in the spreadsheet in which their betting (scores) are inserted in rows like
1-0
1-1
2-4
3-2 ect...
There is one tab to which I enter the actual score as the games are played. These are the real score from which the "logic" checks that how player should be awarded with points.
After hours of inconclusive thinking my question is that how can I make formula that gives me one (1) point, if player guesses the winner corectly (home wins, away wins or the game is tie)?
I already have have system, where I get point for guessing score correctly (if u guess home goals = 1 point and away goals = 1 point, i use formula =IF(EXACT(D2;REALFOOTBALLSCORE.D4);1;0)), but I need one for telling me, that am I rewarded one point for guessing the winner (1X2) or not. I think that in case to do so, I need to play with IF AND nesting. So simplified: what formula tells me that did I guess the winner (1X2) correctly?
Result can also be TRUE or FALSE. The only important thing is, that I get an result of that will I get that one point for 1X2 or not. I use SUM to calculate all points together. It doesn't need to look cool. I hide all the numbers to bottom of the document, where nobody can see them.
Cheers!
I used this formula which also accounts for correctly forecasting a draw as a point:
=IF(OR(Results!F7="",Results!G7=""),"",IF(F7=Results!F7,1,0)+IF(G7=Results!G7,1,0)+IF(OR(AND(F7>G7,Results!F7>Results!G7),AND(F7<G7,Results!F7<Results!G7),AND(F7=G7,Results!F7=Results!G7)),1,0))
I actually built a version that you might find helpful as a starter:
http://we.tl/vHn90XwBTi
You'll need to figure out what you want to do for the knockout stages. If you're only focused on 90min results, just fill down for the remaining fixtures.
Enjoy the world cup!
Basil

Resources