Trade in formula?

Can you take unopened cans of formula and trade it for a different kind? My dr wants us to use a different formula and we still have 4 unopened cans of the one we were using. Can we go to Walmart or target and switch it out?