I'm a late planner, too, but not having a plane ticket tends to worry me. On the other hand, it's October we're talking about, so you may snag a really good fare. To check for what used to be called an "open-jaw" flight (into City X, out of City Y), choose the "Multi-city" option rather than "One-way" or "Round-trip".
I spent 6 days in Berlin last summer and 10 days in Barcelona last month. Those cities are now near, possibly at, the top of my list of "Favorite European Cities". They are both great, and they both have really good tourist infrastructures and non-exorbitant hotel prices, but in some respects they are fairly different. Maybe this will help you make a decision:
Berlin seemed to have far more sites of special Jewish interest. It also has a lot of large museums of both the art and the historical type. There's a nearly unbelievable number of WW II and Cold War sights; this is why I spent six days in the city and still left some significant sites unvisited. Barcelona also has important museums, but I found it a bit easier to pick just a few. If you happen not to be a fan of Picasso or Miro, you've eliminated two of the art museums right there and might be able to stick with just the (unskippable in my view) National Museum of Catalonian Art.
But Barcelona has far more architectural eye candy. There's the Barri Gotic, where you can get your medieval fix, plus a large number of modernista buildings (some with visitable interiors, some walk-bys). I loved just walking from modernista cluster to modernista cluster, interspersed with side trips to many of the visitable (pay-to-enter) sights. It's physically a very attractive city, and a lot of the things you want to see are within walking distance of each other if you have no mobility limitations.
In Berlin the sights are more spread out, so the city feels less walkable. You will need transportation; the S-Bahn, U-Bahn and trams are all good. World War II destruction left the city in ruins, so the city proper doesn't have the sort of historic district we tend to expect in Europe. It's, frankly, not a particularly pretty city. Yes, I know Potsdam is great, and there are other lovely places nearby. I'm talking about the core of Berlin proper. It's not unattractive; it's just not all that memorable.
In late October, if there's a difference in the weather, I believe it will favor Barcelona, but I think you'd mostly be indoors in Berlin.
You should see both of these cities, so one will need to wait for your next trip! Maybe ask yourself: Am I more interested in a sight-intense destination (Berlin), or in walking around and enjoying a European atmosphere and pretty building exteriors with plenty of indoor sights when I am ready to be indoors (Barcelona)?