Units cost you food even if you do not have enough food, they will keep consuming, and what you have might reach zero or less. So the food you produce will not be counted, as it is considered that you are filling the deficit.

To find out the total food used by your unites, go to the board that looks like a billboard. Which is a Troop Info building and looks like a garage, on the left of the Command center, and you can find inside the building info like (Number of units - Total marching troops - Total food use - Damaged units).