Percentage Yield = (Actual Yield ÷ Theoretical Yield) × 100
The Actual Yield is given in the question as 21.2 g of NaCl. However, in order to find the theoretical yield, you have to write a balanced equation and use the mole ratio to calculate the mass of NaCl that would be produced.
Balanced Equation: CuCl + NaNO₃ → NaCl + CuNO₃
Moles of CuCl = Mass of CuCl ÷ Molar Mass of CuCl
= 31.0 g ÷ (63.5 + 35.5)g/mol
= 0.31 mol
the mole ratio of CuCl to NaCl is 1 : 1,
∴ if moles of CuCl = 0.31 mol,
then moles of NaCl = 0.31 mol
Now, Mass of NaCl = Moles of NaCl × Molar Mass of NaCl
= 0.31 mol × (23 + 35.5) g/mol
= 18.32 g
⇒ the THEORETICAL Yield of NaCl, in this case, is 18.32 g.
Now, since Percentage Yield = (Actual Yield ÷ Theoretical Yield) × 100
⇒ Percentage Yield of NaCl = (21.2g ÷ 18.32g) × 100
= 115.7 %
NOTE: Typically, the percentage yield of a reaction is less than 100%, however in a case where the mass of the substance is weighed with impurities, then that mass may be in excess of 100% as seen here.