Probably doesn’t matter to the colleague anymore, but I’ll answer in case someone searches:
If you are considering the score of football games currently, that is, 3 points for a win, 1 point for a draw and 0 points for defeats, then we do the following:
We calculated the maximum number of points a team could earn:
For example, if she played 8 matches, she can earn a maximum of 24 points =(8*3).
So we have number 24.
Now, suppose that this team in these 8 matches won 5, drew 1 and lost 2. In this case (according to the rules of football) she added 16 points.
Now just divide 16 by 24 and multiply by 100 to get the percentage
=(16/24)*100= 66,66
That is, this team had a 66,66% in the 8 matches that played.
Now an observation, if you want to do this calculation using a general basis, without using the scoring system of football or another sport, you can put a win as being 100%, a 50% draw and a 0% defeat. If we use this system in the example above, for example, we would have =8*100%= 800% (which is the maximum number we could reach), as the team won 5 matches and drew 2, he would have 550%, then just split =550%/800% that would give 68.75%.
Although the result is different, both calculations are correct as they use different bases.
You want in PHP or in Excel? You have to decide, if not you keep enlarging the question.
– UzumakiArtanis
Where did these numbers come from? Who said this is the real percentage? Because these percentages of 77 and 44 don’t make sense. The correct would be 66 and 33.
– bfavaretto
If the problem is only of mathematics, it is not in the scope. If it is of programming, click on [Edit] and put only one [mcve] of the problem in the post.
– Bacco
Bacco, colleague. This question has been answered for a long time. This question was supposed to be closed. I don’t know why it’s pending if I’ve already marked the answer.
– Sandson Costa