The adverb formally means "in a formal way." The adverb formerly means "at an earlier time."
- Formerly an art movement, surrealism is no longer distinguishable from everyday life.
- I have never studied art formally.
"Look at the two words with the suffix removed--formal, former. Think of formal invitations, formal dress, formality. In each of these is the idea of
proper manner, politeness, doing things according to form.
Former has to do with time, or order of sequence. Thus we
say On a former occasion he talked about Italian lakes. We
mean that he talked about Italian lakes on a previous occasion.
In a similar manner we say Formerly he worked for
Sage & Allen. You would never think of writing formerlity
for formality; then why is it that sometimes you substitute
formally for formerly? Perhaps you do not, but many
(Alfred M. Hitchcock, Junior English Book. Henry Holt and Company, 1920)
(a) This cafe was _____ a swank restaurant.
(b) Guests were greeted _____ at the door.