How to Calculate Retained Earnings Formula and Examples