it sounds like bios settings is corrupted (which prevents post) when the cmos battery is present and the only time this pc boots is when battery is absent and cmos reverts to factory default.  have you already tried clearing cmos settings by jumper reset?  in my experience this procedure is not identical to taking the battery out.
So I got this PC for my little brother and ever since it arrived I could never get it to boot properly. the specs are : Dell Optiplex 3020 MT  I5 4570t 2c/4t, 2x4gb ram 1600mhz sk hynix, Asus Cerberus gtx1050ti, 500gb Toshiba hdd So the first time I booted it it turned on as soon as I turned on the power strip (didn't press the power button) power button turned amber for a moment then back to white and it did that three times (reset itself 3 times) before it actually posted and I got a bios settings reset error and I had 3 options   So I pressed f2 to go into bios but then it just reset and I had no display and no post and only fan spin with amber light on motherboard (which I know it just means power on) and white power switch.  [IMAGE] After that everytime I try to boot it it just stays on fan spin and no post. I teared it down and tested gpu/ram/hdd/sata cables and everything works, I also noticed the CMOS battery was disconnected and was at the bottom of the case so I just put a new one that I had instead but when CMOS battery is in the pc wont boot at all and the psu green light stays off. After sitting for 2 days I turned it on and it posted again but this time I pressed f5 to do a fPSA test or whatever that was and it passed everything and I pressed exit so it reset and it went into the same no post situation. So I'm guessing it only boots when psu is completely drained? but then once it boots once it wont boot again unless I drain it again? and have no way to drain it since somehow my power button is useless so I have to just leave it for a couple of days? I went through all the troubleshooting process and I took gpu/hdd/sata cables/cmos battery out so I don't run into problems but it just keeps behaving the same way and it's driving me crazy. Is there any tricks or something to get it to run properly? That's all I have sorry it was this long English is not my first language.        
Optiplex 3020 fan spin no boot