From the 1870s to 1900 the White Star Line had a policy of seeing how fast they could do their Liverpool-New York line. The last record holder was the steam ship SS Teutonic in 1890, who reached New York harbour in 5 days, 16 hours and 31 minutes. In the 1900s White Star changed their policy to comfort over speed, so in 1903 the Teutonic took 6 1/2 days again, becoming the last company record holder.
For your 1910s range, we can take a look at the SS Finland. In early 1915 she made two consecutive journeys from Genoa to New York over several Mediterranean harbours. The first starting on February 6th, going over Naples (7th), Palermo (8th) and Gibraltar (12th) and arriving in New York on the 23rd of February. The second one started March 24th, went through Naples (25th), Messina (26th), Palermo (27th), Gibraltar (31st) and Fayal on the Azores (April 4th) and arrived in New York on April 11th.
So if we take Gibraltar as the nearest port the first trip took 11 days and the second one 12 with a stop. Assuming a train or car ride from Madrid to Gibraltar doesn't take more than a few hours you can probably fit the whole journey comfortably into 12 days. Maybe it's slowed down because of the war, but then the Finland's New York-Antwerpen runs the decade before also took about 9/10 days on average.
Sources:
SS Teutonic schedule
SS Finland schedule
Even though planes existed, the fastest transportation would've been by ship since flight couldn't sustain for several hours at a time. The steam-liners were some of the fastest, traveling a maximum speed about 25 knots.
More than likely, you'd travel via a ship similar to RMS Mauretania, which traveled about 24 knots. Assuming it was a straight-line shot not accounting for weather it would've taken close to 5-1/2 days.
But, we also have to consider that Madrid is landlocked. Either Valencia or Balboa would've been the normal ports (need a historian on this). It still would've taken about 5-1/2 days. For now, I'll focus on Valencia.
Then we need to consider driving. Valencia to Madrid is about 189 miles directly. Let's assume that you drove straight and it would add an additional 5-1/2 hours assuming you were in a Ford Model T Touring, which has a maximum speed of about 40-45 mph. Assuming it wasn't straight and we'd use a road structure similar to one that exists today (roughly 400 km), then it would add an additional 6.2 hours.
In total, it was about 6 days. Realistically, it is probably closer to 7 days accounting for weather, changing transportation, and routes.
Edit: Did some editing for clarity sakes.