We have updated the Munich galaxy formation model to the Planck first-year cosmology, while modifying the treatment of baryonic processes to reproduce recent data on the abundance and passive fractions of galaxies from z= 3 down to z=0. Matching these more extensive and more precise observational results requires us to delay the reincorporation of wind ejecta, to lower the surface density threshold for turning cold gas into stars, to eliminate ram-pressure stripping in haloes less massive than ~10^14 Msun, and to modify our model for radio mode feedback. These changes cure the most obvious failings of our previous models, namely the overly early formation of low-mass galaxies and the overly large fraction of them that are passive at late times. The new model is calibrated to reproduce the observed evolution both of the stellar mass function and of the distribution of star formation rate at each stellar mass. Massive galaxies (M>10^11 [Msun]) assemble most of their mass before z=1 and are predominantly old and passive at z=0, while lower mass galaxies assemble later and, for M<10^9.5 (Msun), are still predominantly blue and star forming at z=0. This phenomenological but physically based model allows the observations to be interpreted in terms of the efficiency of the various processes that control the formation and evolution of galaxies as a function of their stellar mass, gas content, environment and time.