This is the 5559th most frequent Japanese word.
がわり
"がわり" means "substitute" or "replacement."
代わり is used to mean 'in place of' or 'substitute for' in this context.
この古い椅子は、机の代わりに使うことができます。
This old chair can be used in place of a desk.
代わりに here functions to indicate an alternative or replacement option.
旅行に行けない代わりに、自宅で特別な料理を作ります。
Instead of traveling, I will prepare a special meal at home.
代わって (roots in 代わり) expresses acting as a representative or substitute for someone else.