Always set and measure saddle height with your dropper fully extended. That is your pedaling position. Enter your seat tube length to check whether your frame accommodates the height above.
Already have your road bike saddle dialed? Use this as your MTB starting point based on the discipline you selected above.
Saddle height is a starting point, not a final answer. Ride the recommended height for a week before making further changes. These formulas assume typical leg proportions. Riders with unusually long femurs relative to total inseam may need to sit lower than the formula suggests. Persistent joint pain during or after riding warrants a professional bike fit.