Try to fix any errors first
If that does not fix errors and you still cannot format it try
Code:
sudo dd if=/dev/zero of=/dev/sdb bs=1M count=1
Check and be absolutely sure that the drive is sdb and double check before you hit Enter, get it wrong and you could wipe the wrong drive - once that is completed try creating a new partition with Gparted and reformat - that code will clear any invalid partitioning data
then check to see if there are any errors reported - Example: mkfs.ext4: Input/output error while writing out and closing file system