The Annual Rate of Return (ARR) is a profitability ratio used to estimate the annual return on an investment. It helps in comparing the profitability of different investments or projects over a one-year period. A higher ARR indicates a more profitable investment. It's a simple yet effective metric for quick investment evaluation.
function calculateARR() {
var initialInvestment = parseFloat(document.getElementById("initialInvestment").value);
var finalInvestmentValue = parseFloat(document.getElementById("finalInvestmentValue").value);
var investmentDurationYears = parseFloat(document.getElementById("investmentDurationYears").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
if (isNaN(initialInvestment) || isNaN(finalInvestmentValue) || isNaN(investmentDurationYears) || initialInvestment <= 0 || investmentDurationYears <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
var totalGain = finalInvestmentValue – initialInvestment;
var annualGain = totalGain / investmentDurationYears;
var annualRateOfReturn = (annualGain / initialInvestment) * 100;
resultDiv.innerHTML = `