Years of Life Lost (YLLs) are computed using the number of deaths in each age category multiplied by the number of years they died prematurely (the potential life expectancy at the age category as determined by a stored vector of standard life expenctancy): 
Years of Life Lost = Deaths in age category * StdLifeExp for age
There are two extra elements that are considered in the computation of YLL – discounting and age weighting. Discounting represents the preference of individuals for current, rather than future, benefits. Age weighting is an attempt to capture age-specific social roles, with working ages more heavily weighted than children or older adults. While controversial, both elements are used in GBD studies and are therefore useful for standard comparisons.
If we initially considered that the number of years lost per each death is the expected life expectancy minus the average age in a given category, then we now need to use the following formula to apply both discounting and age weighting:
Where AWC is the age weighting correction factor (0.1658), this constant compensates so that the global estimated burden of disease remains the same as if not using age weighting. β is the parameter from the age weighting function (0.04). These two constants are related and if you want to change the form of the weighting function by changing β, then you would have to change AWC too. R is the Discount Rate, which we have set to 3 percent to match the GBD study.
YLLWORK uses the same formulations, but only includes the population of 20 to 64 year-olds.