Resonant or close to resonant forced response excitation of compressor blades limits component life time and can potentially lead to high-cycle fatigue failure if the exciting forces are large and damping is insufficient. When numerically quantifying the forcing function by means of simulations, simplifications are typically made in the analysis to reduce complexity and computational cost. In this paper, we numerically investigate how the blade forcing function is influenced by the rotor tip gap flow and by flow across gaps in the upstream variable inlet guide vane row. Unsteady simulations are made using a test rig geometry where a forcing crossing with an excitation from a non-adjacent blade row had previously been measured. The effects of the gaps on the forcing function for the first torsion mode are presented for both the non-adjacent blade row excitation (changes compared with a case without gaps indicating a reduction) and an adjacent excitation (changes indicating an increase in terms of forcing function amplitude comparing with a case without gaps).