He sounds constipated.
A 'normal" poop consistency, per a Pediatric Gastroenterologist, when my daughter was constipated, is that of it having the consistency of oatmeal.
If his poop is rock hard.. .and in balls, then that is constipation. It is uncomfortable and painful to pass.
For his formula... do you put the water in the bottle first then the Formula powder, or do you put in the powder first then the water??? You should put the measured water in the bottle first, then the Formula powder. If not, it can become too 'concentrated.'
He could also be having 'gas' problems as well. Have you tried infant gas drops?
For the constipation, you can try and adding a LITTLE prune juice into his bottle of Formula. The thing is, IF it is constipation...you don't want it to get harder, because then it gets more and more impacted internally, and gets harder and harder to pass...
Or, does he have any reflux problems?
How is his intake during the daytime?
Since he is on solids... this often causes constipation as well. BUT, for the 1st year of life... a baby's PRIMARY source of nutrition in from breasmilk/Formula... NOT solids, NOT other liquids. So... I"m thinking, is he getting enough Intake (of his formula, and on demand?). If not... then perhaps this is causing constipation as well, because he is not taking in enough fluids (which the Formula has water in it already).
But, a baby's digestive system is still developing... and sometimes the just outgrow it.
BUT, I would keep an eye on his constipation... that is why his poops are so hard. Try massaging his tummy gently in circular motions... and bicycle his legs...
all the best,
Susan