the oxidation number of an element is the number of electrons that are gained or lost by the element to form a chemical bond.
the net oxidation number of the ion is its charge.
compound (NH₄)₂Cr₂O₇ is made of cation - NH₄⁺ and anion - Cr₂O₇²⁻
oxidation number of ion - -2
(oxidation number of Cr x 2 Cr atoms) +(oxidation number of O x 7 O atoms )= -2
oxidation number of Cr = y
oxidation number of O = -2
(y x 2) + (-2 x 7) = -2
2y - 14 = -2
2y = 12
y = + 6
therefore oxidation number of Cr is +6