Understanding the unit cell of Chalcopyrite vs its formula
Some of the Copper and Iron lie on the faces of the unit cell.

Copper atoms

The 8 Copper atoms at the corners all represent the same Copper atom so that means only 13 - 7 = 6 Copper atoms.
Then there are an additional 2 repeats on the top and bottom faces and front and back faces bringing it to 4 Copper atoms.

Iron atoms

The Iron atoms similarly have a pair repeat on the left and right faces, the top and bottom faces and the front and back (10 - 3 = 7).
Additionally the 4 Iron atoms in the centre line (from left to right) represent the same atom so thats 7 - 3 = 4 Iron atoms.

This is how the formula and the unit cell are consistent with each other.