The 'lower total cost, higher unit cost' problem is one of the reasons I love the way the EU mandates advertising prices.
i.e. anything sold needs to have the price you actually pay on it (including VAT/other charges), and the cost per unit. (€/l or €/kg).
This saves me an absurd amount of planning/thinking as I can compare an equivalent cost number whenever I see a substitutable product somewhere. Also saves you from being fooled by your own assumptions, like when the unit cost of the largest cereal box is higher than a smaller one.