function calculateHotelOccupancy() {
// 1. Get Elements
var roomsInput = document.getElementById('hor_total_rooms');
var daysInput = document.getElementById('hor_days');
var soldInput = document.getElementById('hor_sold_rooms');
var resultDiv = document.getElementById('hor_result_display');
var errorDiv = document.getElementById('hor_error_msg');
// Result Spans
var rateSpan = document.getElementById('hor_final_rate');
var vacancySpan = document.getElementById('hor_vacancy_rate');
var capacitySpan = document.getElementById('hor_total_capacity');
var occupiedSpan = document.getElementById('hor_total_occupied');
// 2. Parse Values
var totalPhysicalRooms = parseFloat(roomsInput.value);
var timePeriodDays = parseFloat(daysInput.value);
var totalSoldRooms = parseFloat(soldInput.value);
// 3. Reset UI
errorDiv.style.display = 'none';
resultDiv.style.display = 'none';
// 4. Validation Logic
if (isNaN(totalPhysicalRooms) || totalPhysicalRooms <= 0) {
errorDiv.innerText = "Please enter a valid number of physical rooms.";
errorDiv.style.display = 'block';
return;
}
if (isNaN(timePeriodDays) || timePeriodDays <= 0) {
errorDiv.innerText = "Please enter a valid time period (minimum 1 day).";
errorDiv.style.display = 'block';
return;
}
if (isNaN(totalSoldRooms) || totalSoldRooms totalAvailableCapacity) {
errorDiv.innerText = "Error: Rooms sold (" + totalSoldRooms + ") cannot exceed total available capacity (" + totalAvailableCapacity + ").";
errorDiv.style.display = 'block';
return;
}
// 5. Calculation
var occupancyRate = (totalSoldRooms / totalAvailableCapacity) * 100;
var vacancyRate = 100 – occupancyRate;
// 6. Display Results
rateSpan.innerText = occupancyRate.toFixed(2) + '%';
vacancySpan.innerText = vacancyRate.toFixed(2) + '%';
capacitySpan.innerText = totalAvailableCapacity.toLocaleString();
occupiedSpan.innerText = totalSoldRooms.toLocaleString();
resultDiv.style.display = 'block';
}
How to Calculate Occupancy Rate for Hotels
The hotel occupancy rate is one of the most critical Key Performance Indicators (KPIs) in the hospitality industry. It measures the percentage of available rooms that are occupied at a specific time. Understanding this metric is essential for revenue management, operational planning, and assessing the overall health of a property.
The Hotel Occupancy Formula
Calculating your occupancy rate is straightforward. The core formula involves dividing the number of booked rooms by the total number of rooms available, then multiplying by 100 to get a percentage.
Occupancy Rate = (Total Rooms Sold / Total Rooms Available) × 100
However, when calculating over a period of time (like a week or month), you must calculate "Room Nights" rather than just static room numbers.
Step-by-Step Calculation Example
Let's say you own a boutique hotel with 50 physical rooms. You want to calculate the occupancy rate for the month of June (30 days).
Calculate Total Available Capacity: Multiply your physical rooms by the number of days in the period. 50 rooms × 30 days = 1,500 Available Room Nights.
Determine Total Rooms Sold: Sum up all rooms occupied during that month. Let's assume your records show 1,200 rooms were booked in June.
Apply the Formula: (1,200 / 1,500) = 0.80
Convert to Percentage: 0.80 × 100 = 80% Occupancy Rate.
Why Is Occupancy Rate Important?
While occupancy indicates demand, it is rarely viewed in isolation. Revenue Managers use occupancy in conjunction with ADR (Average Daily Rate) to calculate RevPAR (Revenue Per Available Room).
Operational Efficiency: High occupancy requires more staff for housekeeping and front desk operations. Low occupancy might suggest a need to cut variable costs.
Pricing Strategy: If your occupancy is consistently 100%, your room rates might be too low. You may be leaving money on the table by not raising prices. Conversely, low occupancy might indicate your rates are too high for the market.
Benchmarking: Comparing your rate against the "Comp Set" (competitive set) helps you understand your market share.
Common Mistakes in Calculation
When using the calculator above, ensure you handle "Out of Order" (OOO) rooms correctly. Some revenue managers deduct rooms under renovation from the "Total Available" count to get a purely operational occupancy, while owners may want to include them to see the true asset utilization.
For the standard calculation provided here, input the total sellable inventory for the most accurate revenue management figures.