Calories calculation

Hi there! I am wondering how average calories consumed are calculated in the report? I have a report exported for 7 days but the average is never = day1 kcal + day2 kcal +....+ day7 kcal / 7. So I guess the formula is not correct or I dont understand something?
Also curious how calories consumed are calculated per day as well. I've been taught protein x 4 + carbs x 4 + fats x 9 = kcal consumed. What's the Cronometer's formula?
Thanks!