Is she eating mostly green vegetables? That could show up as green in her stools. Constipation could also be her diet, separate from the formula. Eliminate bananas, cheese, dairy products other than her formula, rice. This is opposite of the "brat" diet for diarrhea. I can't remember what the t stands for. I think that perhaps apple juice would have the same affect as applesauce. Apples are good for constipation but only if you leave on the skins. Add roughage to her diet.
Depending on what her previous formula was the dairy make up of the new formula could easily be causing the constipation. Dairy can be constipating. My grandson had a great deal of difficulty with constipation starting around 6 months. He could drink formula but had to stay completely away from other dairy products. After he was a year he mostly drank rice milk. The doctor had his mother add a product to his food but I can't think of it's name now. It used to be only gotten with a prescription but it's otc now. It draws moisture into the intestines to soften the stool.
Because this change may not be related to the new formula or it may just be that her system needs to get used to the new formula I wouldn't change the formula for a couple of weeks. But I would add roughage to her diet and stay away from other dairy products to see if that works. I'd also be sure that she is drinking plenty of liquids. I'd stop the apple juice for now and try prune juice or the apple juice/prune juice combination.
As to the waking up screaming. That, too, may be unrelated to the constipation. When she wakes up screaming does she need to have a bm? Feel of her tummy. Is it too firm? Is it tender? My brothers had difficulty with constipation too and when they were babies my mother would insert her finger in the anus and feel the poop. If it was hard and ready to come out she would help it along. Now you can use a glycerin suppository.