Easy. chainring teeth/cog teeth X 27. "27" because that's the trad road bike wheel diameter. If it's an MTB, use 26. Gear-inches is thus a function of advance distance per pedal stroke. I use a spreadsheet to make the calculations simpler and more adjustable.
__________________
Results matter