Yes, the formula given above is correct. Note that the number of chainrings and cogs doesn't matter, just the differences between the largest and smallest. If you're at all close to the borderline in cage size I'd suggest you pick the larger option. That way it'll still work even if you later make a change in your chainrings or cassette.