Look up one of your recipes to auto-fill its ingredients — no retyping — then fill in what each one cost you.
Cost per piece ÷ (1 − margin%) — the margin is a share of the selling price, not a markup on cost.