I just recently had similar problems... Replaced the motherboarfd, CPU, RAM. My PC started up a couple of time and kept switching off and then wouldnt work at all anymore apart from spinning the fan a couple of secs when switched on.
It turns out it was the PSU! I replaced that and now have a nicely working system.