How many days would you need in each city? Yes , you can visit both Madrid and Barcelona in a single trip and you would need a week to cover both of them efficiently and not feel rushed . Both the cities are well connected via train taking about 2.5 hrs minimum and via road 6 hrs min .