This rail map may come in handy
https://www.seat61.com/reference/interrail-and-eurail-map.pdf
The route from Bern is to take the Eurocity to Milan, then an Intercity and/ or regional train to somewhere on the Italian Riviera. From there, you trundle along the coast to Ventimiglia, where you can pick up a French TER train to Nice.
From Nice there are several options to reach Andorra, depending on where you'd like to stop in France. You can't get the train all the way to Andorra, but you get get nearby on a French train, and then take a taxi or bus the final part.
You can use the German railway website to search for trains. www.bahn.com
You’ll need reservations on the Eurocity from Switzerland to Milan (€11), and on any Intercity (€3), or Freccia (€13) trains in Italy, and any Intercity (€10) or TGV (€10-20) trains in France.
This page on Seat61 explains how to get to Andorra. It’s written as a guide from London, but the last part will be the same for you. https://www.seat61.com/Andorra.htm
I would say 2 weeks is plenty for a leisurely trip. You could stop in Milan, Genoa, Nîmes, Perpignan. All sorts of options.
It’s only 2 or 3 days of travel, really.
Yes, pretty much all the trains you will find on this route are covered - but pay attention to the reservation costs I mention above. They can mount up if you’re not careful. Luckily you have plenty of time, so you can take some slower regional trains here and there if you like.
Between Switzerland and Milan is the absolutely beautiful Bernina Express. It’s slower than the direct Eurocity, but it’s well worth the slight diversion. https://www.seat61.com/trains-and-routes/bernina-express.htm