Calculate progress bar