Formally means conforming to convention, ceremony and proper etiquette. Formally also means precise, methodical, or with official authorization. Formally is the adverbial form of formal. Formally appears in the English language in the late fourteenth century meaning in good form, in an orderly manner.
Formerly means in the past, previously or in earlier times. Formerly is the adverbial form of former. In the early fourteenth century the Middle English word for formerly was andersith, formerly appears in the late sixteenth century.
Examples
Turkey PM formally gives up on coalition as polls loom (The Times of INdia)
The German justice ministry has formally announced the end of a treason investigation aimed at two journalists. (The Register)
The possibility FHL would build something new in Topeka had been on the table for weeks, but the bank hadn’t formally committed until after several incentives packages were approved. (The Topeka Capital-Journal)
The Kitsumkalum and Kitselas can now formally advance into the final stages of their treaty negotiations with the federal and provincial governments thanks to agreements in principle signed today. (The Terrace Standard)
Formerly Homeless Man Once Ashamed Of Teeth Gets New Smile From Kind Dentist (The Huffington Post)
It is, of course, the unpronounceable squiggle representing the days when the singer was The Artist Formerly Known as Prince (these days he is Prince once more). (The New York Times)
This term came into popular South African usage in apartheid’s dying days as black children entered formerly white schools. (The Guardian)
Supreme Pharmaceuticals Inc, formerly a copper and gold explorer with projects in western Canada, is also seeking a license to grow medical marijuana in Canada and has bought a greenhouse facility in Ontario. (Reuters)