Barry,
Some of what you are reporting seems impossible.

Just to be clear, you've said a reformat and reinstall of the OS results in a computer that takes several tries to boot. Once booted, it works normally for any amount of time until you turn it off?
If the above is correct, it should eliminate software as an issue. About the only thing that makes any sense is a thermal problem.
There seems to be some hardware, which when cold does not function but becomes more or less normal when warmed up. That just about has to be bearings in fans or the hard drives.
You can clean and oil fans but there is not much that can be done for failing drives.
You can pinpoint the possibility of a bad drive if it is possible to cold boot to the BIOS and stay active in the BIOS for the amount of time that would cause the computer to shut down.
That would mean the mother board, power supply, and fans are OK. The hard drives are not needed to run the BIOS.