Claims databases consisting of routinely collected longitudinal records of medical expenditures are increasingly utilized for estimating expected medical costs of patients with a specific condition. Survival data of the patients of interest are usually highly censored, and observed expenditures are incomplete. In this study, we propose a survival-adjusted estimator for estimating mean lifetime costs, which integrates the product of the survival function and the mean cost function over the lifetime horizon. The survival function is estimated by a new algorithm of rolling extrapolation, aided by external information of age- and sex-matched referents simulated from national vital statistics. The mean cost function is estimated by a weighted average of mean expenditures of patients in a number of months prior to their death, of which the number could be determined by observed costs in their final months, and the weights depend on extrapolated hazards. We evaluate the performance of the proposed approach in comparison with that of a popular method using simulated data under various scenarios and 2 cohorts of intracerebral hemorrhage and ischemic stroke patients with a maximum follow-up of 13 years and conclude that our new method estimates the mean lifetime costs more accurately.