Changes in the electronic structure of Yb, a material whose valence is modified under pressure, are observed with remarkable detail in x-ray absorption and emission data measured between ambient conditions and 20 GPa. These changes are reproduced by a theory that essentially does not rely on experimental parameters, and includes dynamical core-hole screening. From the combined experimental and theoretical data we can firmly establish on a quantitative level how the valency of an intermediate valence material is modified by pressure. In metallic Yb it increases from 2 to 2.55 +/- 0.05 between 0 and 20 GPa.