See Also Rules for Fields
Trailhead has a good overview of Formulas https://developer.salesforce.com/trailhead/force_com_introduction/point_click_business_logic/formula_fields and rollup summary fields https://developer.salesforce.com/trailhead/force_com_introduction/point_click_business_logic/roll_up_summary_fields and Validation Rules https://developer.salesforce.com/trailhead/force_com_introduction/point_click_business_logic/validation_rules
This is a nice overview of formulas for Salesforce
Other pages in this site about formulas
The Salesforce help has some nice examples https://help.salesforce.com/HTViewHelpDoc?id=useful_advanced_formulas.htm and date formulas https://help.salesforce.com/HTViewHelpDoc?id=formula_examples_dates.htm
Requirement for a field for an expired contract. Users requested a report they can run to show if the contracts are expired (note, this is using a custom contracts object so this can be used on any type of record.
Checklist Formula field.
Requirement for a field to check an expired contract or create a warning. Workflows can be created to task a record owner to check a contract
As above but include "-14" for 14 days before expiry
IF(NOT(ISBLANK(BLANKVALUE(TEXT(BillingStateCode) ,TEXT(ShippingStateCode)))),
BLANKVALUE( TEXT(ShippingStateCode) ,TEXT(BillingStateCode)) & IF(BLANKVALUE(TEXT(ShippingCountryCode), TEXT(BillingCountryCode)) = "AU","", ", " & BLANKVALUE(TEXT(ShippingCountryCode), TEXT(BillingCountryCode))),"")
/*IF(NOT(ISBLANK(BLANKVALUE(TEXT(BillingStateCode) ,TEXT(ShippingStateCode)))),
BLANKVALUE( TEXT(BillingStateCode) ,TEXT(ShippingStateCode)) & IF(BLANKVALUE(TEXT(BillingCountryCode), TEXT(ShippingCountryCode)) = "AU","", ", " & BLANKVALUE(TEXT(BillingCountryCode), TEXT(ShippingCountryCode))),"")*/
Requirement for a field to create a warning that a contract if about to expire
IF (ContractExpiry__c = True, "Contract about to Expire","")
If adding more than one warning add + '; ' + between IF statements
As described here
https://success.salesforce.com/answers?id=90630000000gmVpAAI
Rules for Formulas: