In this paper, we study an optimal consumption and asset allocation problem accounting for the fact that individuals’ utility differs across various health states. Our study is based on the assumption that an individual’s health status evolves through a semi-Markov process, where the transition probabilities are contingent on both the present state and the duration spent in that state. The optimal form of stock investment and of consumption is determined analytically. The optimal consumption level is significantly shaped by the integration of health-related factors and can be represented as the inverse of the marginal utility function with respect to time and state price density. Additionally, we introduce a Lagrangian multiplier that can be derived by solving a fixed point problem. While our optimal solutions are applicable to a wide range of utility functions, we provide numerical illustrations specifically using the power utility function in a model encompassing three distinct health states. Transition probabilities are estimated from real data collected by the China Insurance Regulatory Commission (CIRC), using a high-order polynomial Perks formula. We find that the investor’s consumption is higher when health is good, but lower when care is needed.