Retained earnings are calculated using the formula: Beginning retained earnings + Profits/losses - Dividends = Ending retained earnings. When a company records a loss that exceeds the amount of profit previously recorded as beginning retained earnings, then the company has negative retained earnings.