Thankyou for your reply, but there are only 3 chainwheels & there are 9 cogs.
I am taking note of your rounding code section, as that will be a further neccessary enhancement, as will checking how many chainwheel & cogs have been entered.
I appreciate all answers to my first question on here, & will be trying all suggestions.
Once again, thankyou to all who answered.