Igusa varieties are smooth varieties over $\overline{\mathbb{F}}_p$ which are higher-dimensional analogues of Igusa curves. They were introduced by Harris and Taylor [HT] to study the bad reduction of some PEL Shimura varieties and were generalized by Mantovan [M1], [M2]. The present article gives a group-theoretic formula for the traces of certain operators on the cohomology of Igusa varieties, suitable for applications via comparison with the Arthur-Selberg trace formula. Our formula generalizes the results of [HT, Chap. V, Prop. 4.8] to the case of any PEL Shimura varieties of types (A) and (C) and puts it in a more natural framework, in the spirit of [K7]