We report an extensive study of magnetic excitations in fully oxygenated YBa2Cu3O7, using neutron scattering with and without spin polarization analysis. By calibrating the measured magnetic intensity against calculated structure factors of optical phonons and against antiferromagnetic spin waves measured in the same crystal after deoxygenation to YBa2Cu3O6.2, we establish an absolute intensity scale for the dynamical spin susceptibility, chi ''(q,omega). The integrated spectral weight of the sharp magnetic resonance at h omega=40 meV and q(parallel to)=(pi/a,pi/a) in the superconducting state is integral d(h omega)chi(res)''(q,w)=(0.52+/-0.1) at low temperatures. The energy and spectral weight of the resonance are measured up to T=0.8T(c). The resonance disappears in the normal state, and a conservative upper limit of 30 states/eV is established for the normal state dynamical susceptibility at q(parallel to)=(pi/a,pi/a) and 10 meV less than or equal to h omega less than or equal to 40 meV. Our results are compared to previous neutron-scattering data on YBa2Cu3O7, theoretical interpretations of NMR data and current models of the 40 meV resonance.