I want to make cookies but I am allergic to dairy. Is margarine an acceptable substitute for butter in cookie recipes, and if so, how do I substitute it?
I have a family member who is lactose intolerant, and we often substitute margarine (or various oils) for butter in cooking. We've found that this is mostly interchangeable, but can be unpredictable in baking due to different melting properties. Also, as Marti noted in a comment below, it's a challenge to find unsalted margarine (important if directly substituting for unsalted butter).
I'd love to see any answers on strategies for adapting recipes to account for butter-margarine differences, but in my experience it is easier to either settle for slightly sub-par cookies — or (preferably) to try non-dairy or vegan recipes instead, which are designed with a non-butter fat in mind and therefore have better results.
You might want to try clarified butter, it has negligible amounts of lactose and casein. Since they use it in Indian cuisine (they call it ghee) I reckon it should not cause problems to lactose intolerant people (like most people living in Asia are). It doesn't have the same rich flavor as regular butter, but in my opinion it is still better tasting than margarine.
Maybe add a bit more water when baking, since clarified butter has almost no water, while regular butter has about 20%.
It's absolutely no problem to replace butter with margarine in cookies and actually in any other kind of dough. Just substitute butter with margarine keeping the same proportion.