ALOS is calculated by dividing the total number of days spent by patients in a healthcare facility by the number of discharges during a specific period. The formula is: ALOS = Total number of inpatient days / Total number of discharges This formula provides an average value that can be used to compare different facilities, regions, or time periods.