Read my answer. You will not get a formula or evaluation that will be more than a gross and imprecise estimation because of various factors. So if you plan on calculating the exact number of calories you need every day with a formula, good luck. You might be in the same ballpark, but a 10-15% of error is the norm.
The best way to see, as a whole, if you are consuming an excess or deficit in calories is to do what you normally do. Record EVERYTHING that goes in your mouth (and has calories) over the course of a whole week (including portion size of course), and calculate how many calories you ingest.
Measure your body weight at the beginning of the week (morning weight of the 1st day) and after seven days (so morning weight on the 8th day).
Then take the food log and calculate your average caloric intake over the course of the week… let’s say that it was an average of 2850kcals per day.
Calculate the difference in weight between day 8 and day 1. Lets say you have lost 1lbs over the course of the 7 days.
Right off the bat we know that you have a caloric deficit because your weight went down.
Since it went down by 1lbs we can assume a deficit of between 3500 - 4250 over the course of the week, or 500-600 per day.
So we can assume that on average you are using 2850 + 500-600 = 3350 - 3450 kcals.
That’s not perfect, but outside of having access to a calorimetry chamber and spend your whole day in there you don’t have a much better solution.