I have my friends computer to reformat for him, so I went round to his yesterday to pick it up and it was on, so he shut it down etc.

I brought it back to my plugged all the writes in, monitor, power, keyboard and mouse, turned the power switch at the back on - the computer started for about 5 seconds and went back off, I didn't even press the power button on the front of the computer.

So I came to the front of the machine and pressed the power button and nothing happened, so I took the power cable out the back of the machine 5 minutes ago and when I plugged it back in the machine started up for a few seconds with the fans going and lights on the motherboard and then switched off again

Any idea how to fix this?

Sounds normal. Some machines will spin up briefly when power is plugged in.

There are several cables that connect to the mainboard for HDD light, Reset, and Power. Make sure the power connecter is still on the board.

I think you have a power failure my friend.
Have you tried replacing the power supply of your PC?
Whats the brand and capacity of the power supply you are using?

Sounds like a power supply problem, but try this:
Remove all the power cables from the motherboard.
Remove the memory DIMMS.
Remove the CMOS battery (small disc battery on motherboard)
Leave for 5 minutes
Replace Cmos battery, Dimms and cables and try to power up.