Any pics of the memory card and the pics of failure to format it? I bought two 32 GB Sandisk Ultra Class10 microSD cards for my Lumia 1520 and Xiaomi Note, formatted them in-phone and I have no problems with them, maybe you bought a defective memory card or a cheap, bogus fake pretending to be a genuine Sandisk card.
Yep, you might have bought a defective memory card or a cheap, bogus fake.
If you have bought a genuine but defective memory card then you can have it exchanged at a Sandisk facility or a local agent but if you bought a cheap, bogus fake, then the only thing you can do is buy a new memory card.