The 4-star rated airline Iberia is offering good and cheap last-minute flights to Johannesburg for only £386 return.
These flights include a short connection at the modern Adolfo Suárez Madrid–Barajas Airport. It has plenty of cafes and shops – although unless you choose a long layover you probably won’t have time to really explore them.
The sale fares are available for certain dates between October to December 2018
I would suggest finding the cheapest dates and travel dates that work for you through Google flights (some example dates are 29th Oct – 6th Nov, and 12th Nov – 20th Nov) and then find the cheapest travel agent for those dates using a comparison site such as Momondo or Skyscanner.
Hope this helps someone!