The formula of an ionic compound states a neutral ratio of ions rather than necessarily a discrete molecule. Polyatomic groups such as hydroxide or sulfate must retain their internal subscripts.
How is a positive ion formed? By loss of electrons.
What does an ionic formula express? The simplest electrically neutral ratio of ions.