High-resolution resonant inelastic x-ray scattering (RIXS) has proven particularly effective in the determination of crystal field and spin excitations in cuprates. Its strength lies in the large Cu L3 resonance and in the fact that the scattering cross section follows quite closely the single-ion model predictions, both in the insulating parent compounds and in the superconducting doped materials. However, the spectra become increasingly broader with (hole) doping, hence resolving and assigning spectral features has proven challenging even with the highest energy resolution experimentally achievable. Here we have overcome this limitation by measuring the polarization dependence of the RIXS spectra as a function of momentum transfer and doping in thin films of NdBa2Cu3O7?? . Besides confirming the previous assignment of dd and spin excitations (magnon, bimagnon) in the antiferromagnetic insulating parent compound, we unequivocally single out the actual spin-flip contribution at all dopings. We also demonstrate that the softening of dd excitations is mainly attributed to the shift of the xy peak to lower energy loss. These results provide a definitive assessment of the RIXS spectra of cuprates and demonstrate that RIXS measurements with polarization control are practically feasible and highly informative.