I find the trick is to add a lot of fiber to your diet. I had the same problem the first few months of metformin but now rarely have the problem. It think this comes from the way metformin works to block some carb absorption. Since it doesn't get absorped it ends up as gas.