I don't know if it's any help or not, but GuitarTricks has a handy online-tool called the "Ultimate Scale Finder", which you can find at the top of any page, once you're logged in. This tool lets you see all variants of any scale with the different notes' positions on the fretboard.
As for a formula, I think Christopher Schlegel covers it in the Guitar Fundamentals II course.
Hope this helps :)
"Commit yourself to what you love, and things will happen."
- Mika Vandborg, Electric Guitars, "Follow Your Heart"
---
Gear:
Chateau PS-10 Cherry Power-Strat
Epiphone G-400 LTD 1966 Faded Worn Cherry
Epiphone Les Paul 100 Ebony (w/ Oil City Pickups Scrapyard Dog PLUS pickups)
Epiphone ES-345 Cherry
Fender 2014 Standard Stratocaster Sunburst
Martin DX1K Acoustic
Fender Mustang II Amplifier
Jet City Amplification JCA22H Tube-head and JCA12S+ cabinet
Pedals...