Here is a helpful article from Salesforce on how to  build a formula filed:  https://help.salesforce.com/articleView?id=customize_formulas.htm&type=5