I am pretty new to this concept and I looked on google but I am only finding bland answers. I understand you can trade in 5 materia and get 1 back.

My questions revolve around upgrading materia types. If I put in 5 level 1 strength materia, am I going to get a level 2 strength materia back, or a level 1 intelligence/cp/acc/ect...

Also.. if I put in 5 level 3 materia, is there any chance I am going to get back a level 2 or 1 materia? Is there any sort of control here or is it a complete gamble? I have tons of level 1 and 2 materia piled up and I am unsure if I should transmute it all for higher stuff, or just sell it on the boards.