There's a number of formulas to out there to try. The one that is most accurate for me based on my observed results during hard exercise is: 205- half my age. For those under 40 try 208- half your age.
Had a cardio stress test two years ago. The cardiologist took me to 99% of my theoretical max heart rate and I was conversing with him all the time just starting to huff and puff at 99%. He seemed surpised at my enduarnce and kept asking me during the test if I exercised this intensely as they increased the speed and grade on the treadmill and I answered yes. I'm a distance runner. When I asked him what formula was used to determine max heart rate. He said 220-age and that formula is recommended for the general population by the American Cardiologists Association based on statistics. I suggested to him that the formula was probably invalid for endurance athletes. He gave me a glowing report but as far as I was concerned, the test was a waste of time and money.