An ionic crystal repeats an arrangement of ions in three dimensions. A unit cell describes that repetition, whereas a formula unit describes composition. The two accounting devices answer different questions. Coulomb's law is not restricted to an arbitrarily drawn line connecting one cation to one anion: every ion contributes to the electric field experienced by the others.