Calculating Net Run Rate

Net Run Rate (NRR) Calculator

Net Run Rate (NRR) is a crucial statistic in cricket, particularly in league formats, used to determine team rankings when points are tied. It represents the difference between the average runs scored per over and the average runs conceded per over by a team. A positive NRR indicates that a team is scoring runs faster than it is conceding them, while a negative NRR suggests the opposite.

The formula for NRR is:

NRR = (Total Runs Scored / Total Overs Bowled) – (Total Runs Conceded / Total Overs Bowled)

When calculating NRR for a team over a season or a series, you sum up all the runs scored, all the overs bowled, all the runs conceded, and all the overs bowled by the opposition across all matches played. It's important to use the exact number of overs bowled, not the maximum overs allocated for a match, as matches can be shortened due to weather.

Your Net Run Rate (NRR):

function calculateNRR() { var totalRunsScored = parseFloat(document.getElementById("totalRunsScored").value); var totalOversBowled = parseFloat(document.getElementById("totalOversBowled").value); var totalRunsConceded = parseFloat(document.getElementById("totalRunsConceded").value); var totalOversFaced = parseFloat(document.getElementById("totalOversFaced").value); var resultElement = document.getElementById("result"); if (isNaN(totalRunsScored) || isNaN(totalOversBowled) || isNaN(totalRunsConceded) || isNaN(totalOversFaced)) { resultElement.innerHTML = "Please enter valid numbers for all fields."; return; } if (totalOversBowled <= 0 || totalOversFaced <= 0) { resultElement.innerHTML = "Total overs bowled and faced must be greater than zero."; return; } var runRateScored = totalRunsScored / totalOversBowled; var runRateConceded = totalRunsConceded / totalOversFaced; var nrr = runRateScored – runRateConceded; resultElement.innerHTML = nrr.toFixed(3); } .calculator-container { font-family: sans-serif; border: 1px solid #ccc; padding: 20px; border-radius: 8px; max-width: 500px; margin: 20px auto; box-shadow: 2px 2px 12px rgba(0,0,0,0.1); } .input-section { margin-bottom: 20px; } .input-section label { display: block; margin-bottom: 5px; font-weight: bold; } .input-section input[type="number"] { width: calc(100% – 22px); padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } .input-section button { background-color: #4CAF50; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; } .input-section button:hover { background-color: #45a049; } .result-section { text-align: center; border-top: 1px solid #eee; padding-top: 20px; } .result-section h3 { margin-top: 0; color: #333; } #result { font-size: 24px; font-weight: bold; color: #007bff; }

Leave a Comment