What about flying Dublin - London with
Ryanair and then London - Madrid with
easyJet ? If you can't find a good deal with easyJet, try with the other airlines. There are plenty of them flying London - Madrid.
By the way, remember that if you are flying with different airlines and with separate tickets, connections are not guaranted!!.