Yes there is a formula and it is the Metric BMI (Basal Mass Index) which is height and weight. Less than 18 is considered underweight. Above 40 is Morbidly Obesity.
You can go by your Body Mass Index(BMI) but it does not take incount for how much muscle or fat soem one has. Best way to be is to be between 12-20 percetn body fat for a guy and 15-25 pefecnt body fat for a girl.
If you type BMI into google then there will be several sites that are listed. BMI stands for body mass index and it calculates if you are average weight for your height. Just keep in mind that it doesnt take into account muscle if you are very muscular.