Just for future reference: The S-Bahn is part of the VRS (Verkehrsverbund Rhein-Sieg), which combines the bus, tram and regional train lines in the rhine-region.
For all connections you may use the timetable information in english:
http://www.vrsinfo.de/englisch/the-v...-about-us.html
Regarding the route Cologne - Troisdorf, this is tariff 2b, a single ticket costs 3,80 Euro. A ticket for 4 trips costs 14,10 Euro. Be aware that with 4 trip ticket, you have to validate each trip at the stamp-machines located at the station.
With the same ticket, you may either use the S-Bahn lines S12 towards Au(Sieg), S13 towards Troisdorf and S19 towards Hennef or the regional trains RE8 to Koblenz, RE9 to Siegen and RB27 to Koblenz - whatever comes first.