Signature
L_bar = BD / N
| Inputs | Definition | Unit |
|---|---|---|
BD | Total bed-days of the stays that ended in the period, the sum of L_i over those discharges, counted on one stated rule for same-day stays | bed-days |
N | Number of discharges (stays that ended) in the period, on a stated counting unit such as consultant episode, provider spell or continuous inpatient spell | count, above zero |
L_bar | Mean length of stay over the discharges in the period | days per discharge |
|---|
Function
Average length of stay calculation and bed-day costing function
Maps the bed-days and discharges of a period to the average length of stay (ALOS), and relates length of stay to bed capacity, payment trim points, a case-mix adjusted comparison and the cost of an admission or of a change in stay. The records follow the notation of the Average Length of Stay article, where L_bar is the average stay in days and N the number of discharges.
Computational function
Computational function: average length of stay from admission and discharge dates
Takes patient-level admission and discharge dates and a reporting period, and returns the average length of stay for the discharges in that period. It selects stays by discharge date, computes each stay as the number of changes of calendar day from admission to discharge, sums them to bed-days and divides by the number of discharges, so its inputs are dates rather than the bed-day and discharge totals of HE-FM-ALOS-001. A stay that began before the period is counted in full, and a same-day stay counts as zero days.
Inputs and outputs:
a_i: Admission date of stay i; required. Unit: date.;d_i: Discharge date of stay i, on or after a_i; required. Unit: date.;p_start: First day of the reporting period; required. Unit: date.;p_end: Last day of the reporting period, on or after p_start; required. Unit: date.;L_i: Length of stay i, returned for the stays selected. Unit: days.;N: Number of discharges in the period. Unit: count.;BD: Bed-days of those discharges. Unit: bed-days.;L_bar: Average length of stay. Unit: days per discharge.Assumption: A stay is the unit stated for the analysis (episode, provider spell or continuous inpatient spell), and its dates have already been linked on that basis. No leave days or other deductions apply; where a convention deducts days, as the NHS Payment Scheme and the Australian definition do, the deduction is made to L_i before averaging.
Worked example (Four illustrative stays in March 2026): Stays run from 20 February to 3 March, 2 to 6 March, 10 to 10 March and 25 March to 4 April. The last ends after the period and is left out. The others last 11, 4 and 0 days, giving 15 bed-days over 3 discharges, an ALOS of 5 days.
a_i = [2026-02-20, 2026-03-02, 2026-03-10, 2026-03-25]; d_i = [2026-03-03, 2026-03-06, 2026-03-10, 2026-04-04]; p_start = 2026-03-01; p_end = 2026-03-31; L_i = [11, 4, 0]; N = 3; BD = 15; L_bar = 5Worked example (Same-day stay removed from the input): Dropping the same-day stay, as the OECD convention usually does for day cases, leaves 15 bed-days over 2 discharges and raises ALOS to 7.5 days.
a_i = [2026-02-20, 2026-03-02, 2026-03-25]; d_i = [2026-03-03, 2026-03-06, 2026-04-04]; p_start = 2026-03-01; p_end = 2026-03-31; L_i = [11, 4]; N = 2; BD = 15; L_bar = 7.5Excel:
=SUMPRODUCT((DischDates>=PeriodStart)*(DischDates<=PeriodEnd)*(DischDates-AdmitDates))/SUMPRODUCT((DischDates>=PeriodStart)*(DischDates<=PeriodEnd))With admission and discharge dates in equal-sized ranges named AdmitDates and DischDates, and the period limits in PeriodStart and PeriodEnd, the formula returns the ALOS. Excel stores dates as day numbers, so a subtraction gives days.R:
alos <- function(admit, disch, p_start, p_end) { keep <- disch >= p_start & disch <= p_end; mean(as.numeric(disch[keep]-admit[keep])) }Takes vectors of class Date; as.numeric turns the date differences into days.Python:
def alos(admit, disch, p_start, p_end): stays = [(d-a).days for a, d in zip(admit, disch) if p_start <= d <= p_end]; return sum(stays) / len(stays)Takes lists of datetime.date values; the .days attribute gives the length of each stay.Test (Result equals the mean of a length of stay column): With a helper column StayDays holding DischDates minus AdmitDates, the function result equals AVERAGEIFS over the discharges in the period. Expected result: TRUE. Excel check:
=ABS(SUMPRODUCT((DischDates>=PeriodStart)*(DischDates<=PeriodEnd)*(DischDates-AdmitDates))/SUMPRODUCT((DischDates>=PeriodStart)*(DischDates<=PeriodEnd))-AVERAGEIFS(StayDays,DischDates,">="&PeriodStart,DischDates,"<="&PeriodEnd))<1E-9Test (No discharge before admission): Every discharge date is on or after its admission date. Expected result: TRUE. FALSE shows transposed date columns or a linkage error, which would produce negative stays. Excel check:
=SUMPRODUCT(--(DischDates<AdmitDates))=0Common error (Selecting stays by admission date): Choosing the stays admitted in March in the first example drops the 11-day stay that began in February and adds the 10-day stay that ended in April, giving 14 bed-days over 3 stays and an ALOS of about 4.67 days instead of 5. ALOS is taken over the discharges in the period.
Source: Busby J, Purdy S, Hollingworth W. Calculating hospital length of stay using the Hospital Episode Statistics; a comparison of methodologies. BMC Health Services Research. 2017;17:347. Methods for deriving length of stay from admission and discharge dates in Hospital Episode Statistics, at episode, spell and continuous inpatient spell level.
L_i = d_i - a_i; BD = sum(L_i); L_bar = BD / N
Try this function
Implementations
Excel
Average length of stay in one cell
Excel divides the named cell holding the bed-days of the stays discharged in the period by the named cell holding the number of those discharges.
=TotalBedDays/Discharges
Assumptions
Bed-days and discharges from the same stays
The numerator holds the days of exactly the stays counted in the denominator. Routine statistics often divide a period's occupied bed-days by its discharges or admissions instead, which gives the same figure only when activity is stable over the period.
One stated definition of a stay for average length of stay
The counting unit, the treatment of transfers, whether day cases are included and whether a same-day stay counts as zero days or one are fixed and stated. Figures on different definitions are not compared.
Worked examples
Crude average length of stay for illustrative Hospital A
In the article's illustrative example, Hospital A has 3,050 bed-days over 400 discharges, an ALOS of 7.625 days, reported as 7.6.
BD = 3050; N = 400; L_bar = 7.625
Crude average length of stay for illustrative Hospital B
Hospital B has 4,800 bed-days over 400 discharges, an ALOS of 12.0 days, so on crude figures B looks far less efficient than A.
BD = 4800; N = 400; L_bar = 12
Common errors
Averaging group lengths of stay without weighting
Taking the simple mean of Hospital A's group ALOS values of 4.5 and 17.0 days gives 10.75 days instead of 7.625, because it ignores that A has 300 hip replacement discharges and only 100 stroke discharges. ALOS is pooled from total bed-days and total discharges.
Comparing average length of stay across stay definitions
Busby, Purdy and Hollingworth found a stroke length of stay of 16.5 days using continuous inpatient spells but 12.6 days using provider spells in English data. In the OECD series, the fall from 7.7 days (2021, all inpatient cases for most countries) to 6.5 days (2023, acute care for most countries) reflects a change of scope and cannot be read as a trend.
Sources
OECD definition of average length of stay
OECD. Health at a Glance 2023: OECD Indicators. Paris: OECD Publishing; 2023. Chapter 5, Hospital activity, definition and comparability note for average length of stay. ALOS is generally measured by dividing the total days stayed by all inpatients during a year by the number of admissions or discharges, with day cases usually excluded.
Episode, spell and continuous spell lengths of stay compared
Busby J, Purdy S, Hollingworth W. Calculating hospital length of stay using the Hospital Episode Statistics; a comparison of methodologies. BMC Health Services Research. 2017;17:347. Background on finished consultant episodes, spells and continuous inpatient spells, and the abstract's stroke comparison of 16.5 and 12.6 days.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0