g-factor measurements of excited states in 24Mg