Cost wise it depends on what you can get hold of really, I had everything here already from when I used to run an automated coral farm. It took me about an hour to put it all together and write the program for it.
Solenoid will be about £20, the plc will be £50 plus from ebay upto many hundreds for a very versatile one, be warned though that it's not something you can learn to program in 10 mins, I've used them for years and I still struggle with some bits. Also the software is usually purchased in addition as are programming cables etc all of which aren't cheap.