Return on Investment (ROI) is a fundamental performance measure used to evaluate the efficiency or profitability of an investment. It is designed to help an investor determine how much money they have made or lost on an investment relative to the amount of money they initially put in.
How to Calculate ROI:
The formula for calculating ROI is straightforward:
ROI = ((Current Value of Investment – Cost of Investment) / Cost of Investment) * 100
Where:
Current Value of Investment: This is what your investment is worth today.
Cost of Investment: This is the initial amount of money you spent to acquire the investment.
The result is typically expressed as a percentage, indicating the gain or loss as a proportion of the initial investment. A positive ROI signifies a profitable investment, while a negative ROI indicates a loss.
Example:
Let's say you invested $1,000 in a stock (Initial Investment). After a year, the stock is now worth $1,500 (Current Value).
Gain from Investment = $1,500 – $1,000 = $500
ROI = ($500 / $1,000) * 100 = 50%
This means your investment yielded a 50% return. ROI is a versatile metric that can be applied to various types of investments, from stocks and bonds to real estate and business ventures.
function calculateROI() {
var initialInvestment = parseFloat(document.getElementById("initialInvestment").value);
var currentValue = parseFloat(document.getElementById("currentValue").value);
var roiResultElement = document.getElementById("roiResult");
if (isNaN(initialInvestment) || isNaN(currentValue) || initialInvestment <= 0) {
roiResultElement.innerHTML = "Please enter valid positive numbers for both fields.";
return;
}
var profit = currentValue – initialInvestment;
var roi = (profit / initialInvestment) * 100;
var resultHTML = "