We derive a formula that describes interdiffusion profiles of quantum wells and shows how the formula accurately models interdiffusion in quantum wells of lattice-matched lnxGa1-xAsyP1-y and AlxGa1-xAs alloy semiconductors. Our formula includes the different interdiffusion coefficients between layers and interfacial discontinuity of interdiffused species. Our formula explains how quantum energy shifts due to interdiffusion vary with annealing time and annealing temperature in various wide well layers of both InxGa1-xAsyP1-y/InP and GaAs/AlxGa1-xAs quantum wells. We also show the quantitative difference between interdiffusion profiles of these two materials.