Differentiated cell types often retain their characteristics through many rounds of cell division. A simple example is found in Candida albicans, a member of the human microbiota and also the most prevalent fungal pathogen of humans; here, two distinct cell types (white and opaque) exist, and each one retains its specialized properties across many cell divisions. Switching between the two cell types is rare in standard laboratory medium (2% glucose) but can be increased by signals in the environment, for example, certain sugars. When these signals are removed, switching ceases and cells remain in their present state, which is faithfully passed on through many generations of daughter cells. Here, using an automated flow cytometry assay to monitor white-opaque switching over 96 different sugar concentrations, we observed a wide range of opaque-to-white switching that varied continuously across different sugar compositions of the medium. By also measuring white cell proliferation rates under each condition, we found that both opaque-to-white switching and selective white cell proliferation are required for entire populations to shift from opaque to white. Moreover, the switching frequency correlates with the preference of the resulting cell type for the growth medium; that is, the switching is adjusted to increase in environments that favor white cell proliferation. The widely adjustable, all-or-none nature of the switch, combined with the long-term heritability of each state, is distinct from conventional forms of gene regulation, and we propose that it represents a strategy used by C. albicans to efficiently colonize different niches of its human host.