[noun] + にかわって [noun] + にかわり [noun] + にかわる + [noun]
にかわって means "in place of" or "on behalf of": the noun before it is the person or thing that would normally fill the role, and someone or something else fills it instead. It goes straight after a noun, and in kanji it is written にかわって代わって.
The one who steps in takes が in the main clause. The noun before にかわって names whoever was meant to do it – give the speech, teach the class, attend the meeting.
With things rather than people, にかわって says one thing has taken over from another for good.
Both translate as "instead of". にかわって is formal: speeches, announcements, news, writing. In conversation のかわりに is the everyday choice, and it also covers a trade – doing one thing and not another, or getting something in return.
にかわって takes a noun only. To say "instead of doing", use a verb with かわりに: ×行くにかわって → 行くかわりに.
The kanji is かわる代わる, "to take the place of". かわる変わる is "to change", and にかわって変わって means "turning into".
These go beyond "in place of" a person.
にかわり is the stem form of the same pattern. It means the same and sounds a little stiffer, so you see it in writing and in formal announcements.
Before a noun, the form is にかわる.
With a job or a position, にかわって can mean that someone has succeeded the person before them.