Calculator by MarkupMarginTools
Use the same period for every number. Which costs count as "cost of goods" and which as "operating expenses" depends on your business; your accountant can tell you how to split them.
This calculator needs JavaScript. The rules it uses are written out below.