N3
に代わって
にかわって
In place of, On behalf of, To succeed
妹に代わって、私が買い物に行くことに決まった。
It has been decided that I am going to go shopping in place of my sister.
Explanation
「に代わって」 has 2 uses
1On behalf of
Someone acts in place of another who can't: 「社長に代わって、私がご挨拶します」.
月に代わってお仕置きよ。
On behalf of the moon, I will punish you!
タナカさんに代わり、今日は私があなたたちの担当をします。
In place of Tanaka-san, today, I am going to be in charge of you guys.
2Replacing
Something new takes the place of the old, often 「に代わり」 in writing: 「現金に代わって、電子マネーが広まった」.
世界中ではファックスに代わりメールが主流になったが、日本ではまだファックスしか使わないところが多い。
All around the world, fax has been replaced by email as the main form of communication, but there still are places in Japan that only use fax.
西暦2000年始めにFAXに代わりメールが主流になった。
Around the start of 2000, email replaced fax as the mainstream.