I am traveling to Barcelona this October and wish to take a day-trip to Andorra. Is this possible?
It's definitively possible. If you check Google Maps, you can see that an one-way journey takes approximately 3 hours.
So If you leave early morning, you can be there on late forenoon. Then you can spend some hours there and go back late evening.
However, you have to decide by yourself if that's reasonable for you. You will have to drive a long time in one day. Maybe it is worth to think about staying at least one night in Andorra. It also depends on your plans in Andorra. Do you just want to visit it once to increase your country counter, or do you want to do some hiking there?