I had many problems to fix the grub on my Ubuntu Gnome 14.10.
In my case, I formatted both Linux and windows, but this can help if you only format your Ubuntu.
Go to the BIOS interface, disable security boot and change legacy boot mode to UEFI boot mode.
Install your Windows 8.? (normal procedure)
PS: if you do not want change you previous Windows you can start here.
Go to the BIOS, stay disable BOOT and change UEFI to Legacy.
Start your media (pen drive or whatever) and install Ubuntu Gnome.
That steps are important. You should create 4 new partitions where, this link can help as well: http://pplware.sapo.pt/linux/dual-boot-com-windows-8-e-ubuntu-12-10-uefi/
way system type size of /boot ext2 primary (300Mb?) / ext4 logical (as you want) /home ext4 logical (as you want) /swap (4000Mb)
You can install your Ubuntu now, BUT make sure that you are installing in
Xshould be de directions of your boot system)
Now you have Ubuntu Gnome installed, so lets fix the grub. Again, go to the BIOS and set Legacy mode to UEFI, still disable boot...
Start Ubuntu from your media and choose the option, try Ubuntu. In this steps you gonna reconfigure your grub. An easy way is https://help.ubuntu.com/community/Boot-Repair. You can follow these steps and install. My advise is, after installed choose the option advanced settings and check if the path of your boot from Ubuntu and Windows are ok, then apply. The program can do some questions and say to you past some commands at the terminal, just do that and when it ask for remove your grub choose NO!
PS: I had many many problems here. In my case when I installed Ubuntu Gnome using the boot mode in UEFI it never fixed the grub. When I installed this in legacy mode not works as well! It only works when I installed the Ubuntu in legacy mode, then I reboot it go to BIOS and change the Legacy to UEFI and after in Ubuntu try mode from media and install boot repair.
When boot-repair finish the procedure you can reboot your computer.
In some cases this is enough to grub2 ask which OS you want, if no, probably there will be a black screen when you turn on the computer. If it happens, go to the BIOS, again rsrs, change the security boot mode to > Enable and still boot fro
I hope everything goes well for you! =D