Formulas are defined by the user and used to calculate certain results. Formulas are either simple or complex and can consist of values, functions, defined names, etc. A function, on the other hand, is a built-in piece of code that is used to perform a specific action. Excel provides a huge number of built-in functions like SUM, PRODUCT, IF, SUMIF, COUNT, etc.