Formatted now can't install OS
Hi
I've recently formatted my imac (late 2015) to be reset to factory setting.
After formatting and trying to reinstall the OS (Sierra) it's saying that the disk has errors which I can't repair when I try to run the disk utility.
I've tried to reinstall the OS but it only goes half way then exits, I'm kinda in an endless loop of jot being able to start the mac back up properly.
Any suggestions on how I can proceed. I have another mac same year which is working so I can download anything I need to aid the currently not working one.
TIA
iMac Line (2012 and Later)