I got a similar issue last week. The workaround that worked for me (might not be the “cleanest” solution) is adding an extra column.

The field temp_formula contains my lookup formula. The additional field Calories_ingredients uses the formula sum(field(‘temp_formula’)). I refer to that field in further calculations.

In the final result, I hide the column temp_formula from the user.