The first thing to do is to measure the pitch of the leadscrew. Suppose its 4TPI. So if you have a 1:1 gearing between the spindle and the lead screw then it will cut a 4 TPI thread. If you change the ratio to 1:2, then the lead screw will rotate 1/2 turn for a full turn of the spindle so the thread cut will be 8 TPI. The actual number of gear teeth being used can be ignored, its the ratio that is important. Extra gears can be put singly into the train to absorb space so the teeth all mesh. These are called idlers and do not change the ratio or the TPI being cut..
For example:- to cut a 20 TPI thread. This needs a 1:5 ratio so as you will not have a 100T and a 20T gear, you need to split the ratio into 2 1/2 :1 and 2 :1. So a 20T on the spindle and 50 on the leadscrew, this will give you the 2 1/2 :1. So some where in between them you need an extra 2:1 and some idlers to space the gears so they can mesh properly. So using a 30T and a 60T. they need locking together so they rotate as one. The 60 needs to mesh with the 50 on the lead screw, the 30T with the spindle's 20T, so a free running idlers needs to be put in between them.
Once you have found the leadscrew TPI and any fixed gearing so the ratios for some thread can be found, then the remainder can be found from a chart that uses the same gearing for the same TPI (as in the above example).
Other solutions are available.
Frank