What is the difference between a Chemical Formula and Formula Unit?

In my textbook, a chemical formula is described as :

"A formula that shows the kinds and numbers of atoms in the smallest representative unit of a substance"

While a formula unit is described as :

The lowest whole number ratio of ions in an ionic compound. Thus the formula unit for sodium chloride is NaCl.

Though the definitions seem to differ, the written formulas appear identical. A chemical formula appears to be another way to represent a formula unit. For example, NaCl is both the chemical formula and formula unit for Sodium Chloride. Is there ever a difference between the written terms?