Real Estate Absorption Rate Calculator
The absorption rate is a key metric in real estate that indicates how quickly homes are selling in a given market. It's calculated by dividing the number of homes sold in a period by the total number of homes available in that same period. A higher absorption rate generally suggests a seller's market, while a lower rate indicates a buyer's market.
function calculateAbsorptionRate() {
var homesSold = parseFloat(document.getElementById("homesSold").value);
var homesAvailable = parseFloat(document.getElementById("homesAvailable").value);
var periodInMonths = parseFloat(document.getElementById("periodInMonths").value);
var absorptionRate = 0;
var marketAnalysis = "";
if (isNaN(homesSold) || isNaN(homesAvailable) || isNaN(periodInMonths) || homesSold < 0 || homesAvailable <= 0 || periodInMonths <= 0) {
document.getElementById("absorptionRateResult").textContent = "Please enter valid positive numbers for all fields. Homes available must be greater than zero.";
document.getElementById("marketAnalysis").textContent = "";
return;
}
// Calculate monthly absorption rate
var monthlyAbsorptionRate = homesSold / homesAvailable;
// Calculate months of supply
var monthsOfSupply = homesAvailable / homesSold;
// Overall absorption rate (homes sold per month)
absorptionRate = monthlyAbsorptionRate * 100; // Percentage
document.getElementById("absorptionRateResult").textContent = `${absorptionRate.toFixed(2)}% of the available inventory sold per month during this period. This indicates ${monthsOfSupply.toFixed(2)} months of supply.`;
// Market analysis based on months of supply
if (monthsOfSupply = 3 && monthsOfSupply 6) {
marketAnalysis = "This is a buyer's market. Homes are taking longer to sell, indicating lower demand or higher inventory.";
}
document.getElementById("marketAnalysis").textContent = `Market Analysis: ${marketAnalysis}`;
}
.real-estate-calculator {
font-family: sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
background-color: #f9f9f9;
}
.real-estate-calculator h2 {
text-align: center;
color: #333;
margin-bottom: 20px;
}
.real-estate-calculator p {
line-height: 1.6;
color: #555;
}
.calculator-inputs {
margin-top: 20px;
display: grid;
grid-template-columns: 1fr;
gap: 15px;
}
.form-group {
display: flex;
flex-direction: column;
}
.form-group label {
margin-bottom: 5px;
font-weight: bold;
color: #444;
}
.form-group input[type="number"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
}
.real-estate-calculator button {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease;
margin-top: 10px;
}
.real-estate-calculator button:hover {
background-color: #45a049;
}
.calculator-result {
margin-top: 30px;
padding: 15px;
border: 1px solid #eee;
border-radius: 4px;
background-color: #fff;
text-align: center;
}
.calculator-result h3 {
margin-top: 0;
color: #333;
}
#absorptionRateResult {
font-size: 1.2em;
font-weight: bold;
color: #007bff;
margin-bottom: 10px;
}
#marketAnalysis {
font-style: italic;
color: #666;
}