calculate endSum for account