The only accurate way would be a metabolic ward. You are locked in a room, the gas exchange is monitored, your food is all weighed, as is your poop. You also have body composition data like DEXA or Bodpod readings to figure out the proportion of differently metabolically active tissues.
There is no actually accurate way to know with maths, even if you weigh yourself daily. Your weight doesn’t indicate body composition. You could gain fat and lose muscle, your weight could stay the same, but you’d actually be eating in a caloric excess.
There are many different formulas. One of the OG was the Harris-Benedict
For men: BMR = 66.5 + (13.75 weight in kg) + (5.003 height in cm) - (6.75 * age)
For women: BMR = 655.1 + (9.563 weight in kg) + (1.850 height in cm) - (4.676 * age)
That adaptive TDEE spreadsheet that you linked would be the most accurate way to estimate your TDEE. Basically what it’s doing is taking a) your caloric intake over time and b) the change in your weight over time, and using those two pieces of information to calculate your TDEE. To illustrate how it works:
Suppose that you’ve been eating 2200 calories every day for the past 3 months, and over those 3 months, your weight stayed exactly the same. That would mean that your TDEE is around 2200 - which makes sense, since you were able to maintain your weight while eating 2200 calories on average.
But suppose your friend also ate 2200 calories every day for the past 3 months, and over those 3 months, they lost 6 pounds. That’s a rate of weight loss of around 0.5 lbs per week, which is equivalent to a deficit of 1750 calories weekly, or 250 calories daily (note: 1 lb = 3500 calories). So that would mean that their TDEE is around 2200+250 = 2450 calories.
This is essentially what the spreadsheet is doing, except that it’s taking into account every single data point (daily calorie intake and weight), rather than just looking at the start and end, as I’ve shown in my example.