Since the Economic Production Quantity (EPQ) model was proposed by Taft almost a century ago, different authors have developed new models to obtain optimal lot size values closer to real ones. Even so, there is still much research to do in this field, mainly in taking into account not only productive but logistics costs when determining the optimal lot size. To fill this gap, the model proposed in this work considers several logistics and productive issues, while goes further by incorporating the possibility of working in n stages, idea almost not taken into account in previous works. Even more, the possibility of working with constraints – a main characteristic of real productive processes – is also considered. Finally, and as an additional contribution, a nonlinear programming that solves the proposed model – and how to face such programming with MS Excel® – is also detailed.