Functions within computer programs often contain formulas. These formulas are used to process data that is passed through the function and output the result. For example, a basic formula might convert inches to centimeters. This type of formula may used in a metric units conversion function. Formulas and functions are similar, and the terms are even sometimes used interchangeably. However, it is important to know that formulas are often the building blocks of functions, and not the other way around.
Formulas are also commonly used in spreadsheets. Most spreadsheet applications allow users to enter formulas into cells instead of static data. For example, if a spreadsheet contains numbers in columns A and B, column C could be used to total the numbers in the respective rows of columns A and B. This would be accomplished by entering the formula "=A2+B2" in C2, and "=A3+B3" in C3, and similar functions in the rest of the cells in column C. More advanced spreadsheet formulas can be used to determine the average of multiple cells, divide cells by the results of other formulas, and perform other complex operations.