Dont format your PC if grub is not working,
ask someone experienced for help.
Meanwhile you can still access windows from grub prompt,
just use following commands.
grub> rootnoverify (hd0,0)
here, the thing in bracket represents your drive number and windows
partition number.(which most commonly 0, 0)
grub> chainloader +1
grub> boot
and the windows will boot.