Formation of gaseous atoms:
Changing the elements in their standard states into gaseous atoms.
This change is endothermic as it involves bond breaking.
Formation of gaseous ions:
Changing the gaseous atoms into gaseous ions.
Overall, the change is endothermic.
Changing the gaseous ions into the solid ionic lattice.
This is the lattice enthalpy and is exothermic.