The Accounting Rate of Return (ARR) is a profitability metric used in capital budgeting to estimate the profitability of a potential investment. It is calculated by dividing the average annual profit from an investment by the initial investment cost. A higher ARR indicates a more profitable investment.
function calculateARR() {
var initialInvestment = parseFloat(document.getElementById("initialInvestment").value);
var averageAnnualProfit = parseFloat(document.getElementById("averageAnnualProfit").value);
var salvageValue = parseFloat(document.getElementById("salvageValue").value);
var usefulLife = parseFloat(document.getElementById("usefulLife").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
if (isNaN(initialInvestment) || isNaN(averageAnnualProfit) || isNaN(salvageValue) || isNaN(usefulLife) || usefulLife <= 0 || initialInvestment <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields, and ensure Useful Life is greater than 0.";
return;
}
// Calculate average annual depreciation
var depreciation = (initialInvestment – salvageValue) / usefulLife;
// Calculate average annual book value
var averageBookValue = (initialInvestment + salvageValue) / 2;
// Calculate Accounting Rate of Return
var arr = (averageAnnualProfit – depreciation) / averageBookValue;
// Convert to percentage
var arrPercentage = arr * 100;
resultDiv.innerHTML = `
Average Annual Depreciation: ${depreciation.toFixed(2)}
Average Book Value: ${averageBookValue.toFixed(2)}
Accounting Rate of Return (ARR):${arrPercentage.toFixed(2)}%
`;
}
.calculator-container {
font-family: sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 8px;
background-color: #f9f9f9;
}
.calculator-container h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
}
.calculator-inputs {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
margin-bottom: 20px;
}
.input-group {
display: flex;
flex-direction: column;
}
.input-group label {
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
.input-group input[type="number"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
}
.calculator-container button {
display: block;
width: 100%;
padding: 12px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
font-size: 1.1rem;
cursor: pointer;
transition: background-color 0.3s ease;
}
.calculator-container button:hover {
background-color: #0056b3;
}
#result {
margin-top: 25px;
padding: 15px;
border: 1px dashed #ddd;
background-color: #fff;
border-radius: 5px;
text-align: center;
}
#result p {
margin-bottom: 10px;
font-size: 1.05rem;
line-height: 1.5;
}