MARCStats - HELP!

Alright… I’ve got the following code for MARCStats when a match’s data is entered:

// Calculate penalized and unpenalized score totals
	$rupentotal = $rscore + $rbonus; // Unpenalized = Raw + Bonus
	$rpentotal = $rscore - $rpen + $rbonus; // Penalized = Raw - Penalites + Bonus
	$bupentotal = $bscore + $bbonus;
	$bpentotal = $bscore - $bpen + $bbonus;
	
	// Set penalty minimum
	if ($rpentotal < 0) {
		$rpentotal = 0;
	}
	if ($bpentotal < 0) {
		$bpentotal = 0;
	}
	
	// Calculate seeding scores and coopertition scores
	// If red wins the match...
	if ($rpentotal > $bpentotal) {
		$rseed = $rpentotal + 5 + (2 * $bupentotal);
		$rcoop = (2 * $bupentotal);
		$bseed = $rupentotal;
		$bcoop = 0;
	}
	// If blue wins the match...
	elseif ($bpentotal > $rpentotal) {
		$bseed = $bpentotal + 5 + (2 * $rupentotal);
		$bcoop = (2 * $rupentotal);
		$rseed = $bupentotal;
		$rcoop = 0;
	}
	// If there is a tie...
	elseif ($rpentotal == $bpentotal) {
		$rseed = $rpentotal + (2 * $rpentotal);
		$rcoop = (2 * $rpentotal);
		$bseed = $bpentotal + (2 * $bpentotal);
		$bcoop = (2 * $bpentotal);
	}

Now… I think these formulas are all working. I was working on it with one of the FTA’s (thanks, Keith), and it looks like I was just fed bad data. I’ve attached the match data and ranking data I’ve collected, up to match 43.

If you visit this link, you can see that the rankings here don’t very well match the actual results. There are, however, some well-defined patterns in the differences with several of the discrepancies. I’ll let you guys find those, as I’m too lazy to type out all the differences.

Anyone wanna offer some help? :frowning:

Note: Ignore the colors in the scores file. Those were for my assistance. The dark blue teams, however, are the ones with perfect ranking data.

rank.xls (21.5 KB)
scores.xls (44.5 KB)


rank.xls (21.5 KB)
scores.xls (44.5 KB)

The formulas look right to me. Have you tried writing your inputs and outputs to a file to see if they match properly?

Have you also checked that the input data in your system matched the reference that you have?

Most or all data matches, however, I’m missing the raw data from some of the matches, so those may very well be wrong.

bump