Excel::Template correctly handles this by reusing formats wherever possible. You might want to look at that.
The key item is that Spreadsheet::WriteExcel doesn't merge identical formats because you can change what a format does after you've applied it to a cell.
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Comment on Re: Spreadsheet::WriteExcel Too Many Formats Problems