Elements exist in different physical states at room conditions. Intermolecular force can affect the value of ionization energy and electron affinity.
In gaseous state, there is little intermolecular force in the substance and it can be considered as negligible in some cases. So, the values of ionization energy and electron affinity is almost unaffected if they are calculated for gaseous phase.