Affordability of battery energy storage critically depends on low capital cost and high lifespan. Estimating battery lifespan, and optimising battery management to increase it, is difficult given the associated complex, multi-factor ageing process. In this paper we present a battery life prediction methodology tailored towards operational optimisation of battery management. The methodology is able to consider a multitude of dynamically changing cycling parameters. For lithium-ion (Li-ion) cells, the methodology has been tailored to consider five operational factors: charging and discharging currents, minimum and maximum cycling limits, and operating temperature. These are captured within four independent models, which are tuned using experimental battery data. Incorporation of dynamically changing factors is done using rainflow counting and discretisation. The resulting methodology is designed for solving optimal battery operation problems. Implementation of the methodology is presented for two case studies: a smartphone battery, and a household with battery storage alongside solar generation. For a smart-phone that charges daily, our analysis finds that the battery life can be more than doubled if the maximum charging limit is chosen strategically. And for the battery supporting domestic solar, it is found that the impact of large daily cycling outweighs that of small more frequent cycles. This suggests that stationary Li-ion batteries may be well suited to provide ancillary services as a secondary function. The developed methodology and demonstrated use cases represent a key step towards maximising the cost-benefit of Li-ion batteries for any given application.