A fundamental problem in biology is how cells organize their resource investment. Cellular metabolism, for example, typically involves hundreds of enzymes and metabolites, but it is unclear according to which principles their concentrations are set. Reasoning that natural selection will drive cells towards achieving a given physiological state at minimal cost, we derive a general equation that predicts the concentration of a metabolite from the concentration of the most abundant and costly enzyme consuming it. Simulations of cellular growth as well as experimental data demonstrate that costs are approximately proportional to molecular masses. For effectively irreversible reactions, the cell maximizes its metabolic efficiency by investing equally into substrate and unbound enzyme molecules. Without fitting any free parameters, the resulting model predicts in vivo substrate concentrations from enzyme concentrations and substrate affinities with high accuracy across data from E. coli and diverse eukaryotes (R^2=0.79, geometric mean fold-error 1.74). The corresponding organizing principle - the minimization of the summed mass concentrations of solutes - may facilitate reducing the complexity of kinetic models and will contribute to the design of more efficient synthetic cellular systems.