If I understand correctly, you need to replace column SumPurchased with a column Balance before recipe.
In current configuration the Balance column doesn’t account for other recipes that were used earlier that day.
It’s impressive, thank you so much for your support, as I don’t have (yet) this skill level When I see the formula, I can get the logic, now it’s the challenge for me to learn to find such solution on my own.
It’s showing again how valuable the input in communities like this, are