Hierarchy Rollup

Does anyone know the formula for the hierarchy rollup of children to parent. I want the % complete to be calculated automatically for the parent, based on the % complete of all the children. Apparently it is supposed to happen automatically, but it is not for me. I'd like to add it manually. Thanks