Flux rss

Spreadsheet - Formulas

Introduction to Formulas

The main use of a spreadsheet is to automate calculations, which means using cells to perform operations based on values in other cells. The spreadsheet recalculates all the values each time a change is made to the value of a cell.

A formula is used to represent an expression, which, one entered into the cell, allows the spreadsheet to perform automatic calculations based on values in other cells and to display the result.

Formulas may also contain references to other cells, expressions, or functions.

Entering a Formula

Entering a formula is done by selecting a cell and by using the formula bar.

Microsoft Excel formula bar

To enter a formula, start by entering the equal sign (=) and then enter the cell references of the cells to be used and the operators and/or functions.

It is also possible to click on the button Formula on the formula bar. The example below demonstrates the use of a formula in cell C15 to calculate the sum of cells D11 and D13.

Entering a formula in Microsoft Excel

When the Enter is pushed, the spreadsheet calculates the value of cell C15 and displays the result:

Interpreting a formula in Microsoft Excel

Practical Example

In the example below, the use of formulas to automatically calculate the price with tax included (Tax included) of a list of articles for which the "Before Tax" (BT) price is given, and then to calculate the total price of these articles is shown.

Tax Included price calculation for an article given the pre-tax value and the VAT

To obtain the Tax Included price for article 34FR453, add the value of the tax to the pre-tax value, meaning the pre-tax value multiplied by the VAT (19.6% in this case):

Amount_TI = Amount_BT + Amount_BT*VAT

In the above example,

  • the TI amount is located in E6,
  • the BT amount is located in D6,
  • the VAT amount is located in D11,
which gives the following formula:
= D6 + D6*D11

To calculate the TI amount for article 34FR453, first select the cell corresponding to this calculation (E6) and then start entering the formula (either by starting with the equal sign or by clicking the formula button).

The spreadsheet is therefore in the formula entering mode, and:

  • either enter the formula directly with the keyboard
  • or build the formula by selecting the cells one at a time

In the second example, clicking on cell D6 will automatically add its name to the formula bar. Another click on this cell will display D6+D6 because addition is the default operation in the spreadsheet. Push the * button to choose multiplication, and then select cell D11.

To finish entering the formula, push the Enter button on the keyboard or use the Enter button on the formula bar. The spreadsheet will display the result of the calculation in cell E6:

Tax Included price calculation for an article given the pre-tax value and the VAT

Copying Formulas

Imagine that we want to copy this formula and use it for the other articles. Select the formula in (cell E6), copy it, and select the block of cells from E7 to E9 (written E7:E9) and paste the previously copied formula. Here is the result:

Copying a formula in Excel

Note that the copied formula does not produce the correct amounts:

Errors when copying a formula in Excel

In effect, when clicking on one of these cells, it can be noticed that the spreasheet references the correct price before tax, but that the reference to the cell with the VAT value is wrong (D13 instead of D11).

This is because the previously entered references were relative references. The spreadsheet therefore performs an automatic offset on cell references when copying the formula. Thus, to avoid the spreadsheet offsetting the cell with the VAT value, use an absolute reference ($D$11). Let's redo the formula:

Using an absolute reference in a formula

The spreadsheet now gives a coherent result:

Formula result with an absolute reference

Using Functions in Formulas

Functions may also be used in formulas, thus allowing advanced calculations. Most spreadsheets offer a large number of integrated functions (Excel has more than 400).

Let's redo the above example. To automatically calculate the pre-tax total and the TI total of orders, use the Sum() function. To do this, select the cell in which to display the sum and enter the formula (starting with the = sign) using the Sum() function. There are many ways of entering the Sum() function:

  • by manually entering it in the formula bar
  • by using the function button that allows the function to be chosen from a list:

    Using the function button

  • by using the sum button directly

    Using the sum button

Whatever method chosen, the two arguments of the Sum() function must be specified, which means specifying the cells for which the sum is to be calculated. There are two further possibilities for the user:
  • enter the references of the selected cells on the keyboard
  • select the cells or the blocks of cells to be used

Use of the sum function

Here is the result calculated by the spreadsheet:

Result of the sum function



Last update on Thursday October 16, 2008 02:43:17 PM.
This document entitled « Spreadsheet - Formulas » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.
Spreadsheets - Worksheets Spreadsheets display data and formulas in a table form (lines and columns) called a worksheet. A worksheet is made of lines (numbered with numbers) and of columns (numbered with letters). The intersection of a line and a column is called a cell. A... en.kioskea.net/tableur/tabfeuille.php3
[ExcelStorage name and path of a spreadsheet [ExcelStorage name and path of a spreadsheet The tip below will show you how to automatically show the storage path and the name of any spreadsheet Enter in a cell (E.g cellA1) the following formula: =cell("filename", A1) Upon... en.kioskea.net/faq/sujet-1152-excelstorage-name-and-path-of-a-spreadsheet
Pretty Basic Excel Macro Help Hello, I am writing a macro (which will be used to create a VB6 program) in Excel 2003. The spreadsheet Update_Log is a database with 9 user input columns and 7 columns which are calculated by formulas based on user input. I need to create a macro... en.kioskea.net/forum/affich-15106-pretty-basic-excel-macro-help
Basic Excel FormulasBasic Excel Formulas Below are some basic formulas for Microsoft excel: Basic formula : ADDITION cell A1 to A10 = sum (A1: A10) AVERAGE cell A1 to A10 = average (A1: A10) MAXIMUM cell A1 to A10 = max (A1: A10) MINIMUM cell A1... en.kioskea.net/faq/sujet-1114-basic-excel-formulas
[VBA]Updating a procedure or function[VBA]Updating a procedure or function Managing a workbook,provided that only the standard functions of the spreadsheet are available,is a very difficult process. The logical step is to make use of Visual Basic Applications (VBA).... en.kioskea.net/faq/sujet-1176-vba-updating-a-procedure-or-function
Excel Macro HelpHello, I am writing a macro in Excel 2003. The spreadsheet Update_Log is a database with 9 user input columns and 7 columns which are calculated by formulas based on user input. I need to create a macro that finds the last record in column A, moves... en.kioskea.net/forum/affich-15107-excel-macro-help
Extracting data based on an intervalHello, Hi i have a spreadsheet of invoices with the name, date descritpiton and total. I have added a combined total. I need to search the spreadsheet by say an interval of every $1,000 per invoice value (in the combined total). Is there a formula i... en.kioskea.net/forum/affich-38791-extracting-data-based-on-an-interval
Excel Number FormatsHello, I am trying to figure out a formula so that I can have one numer showing, but for it to have a different value. Example: 2^7 as the value in Cell A1 1 showing in Cell A1 I am trying to create a spreadsheet that will calculate a subnet value up... en.kioskea.net/forum/affich-30641-excel-number-formats
Download Formula™ Vibration Feedback WheelA new wonder from Logitech to impress the gallery!!. It is flying which resembles to so many others will say you? You are mistaken, Formulated it Vibration Wheel Feedback is flying which offers rather particular feelings that it is necessary it to... en.kioskea.net/telecharger/telecharger-968-formulaa-vibration-feedback-wheel
Download BIOS for motherboard Rampage FormulaYou like powerful Workstations? You are going surely to like the motherboard Rampage Formula from ASUS, this small technological jewel supports processors with numerous hearts of data processing and has to envy nothing the others. However, it is... en.kioskea.net/telecharger/telecharger-1469-bios-for-motherboard-rampage-formula
Download OpenOfficeOpenOffice is a free office application suite, including a word processor, spreadsheet, presentation tool, drawing package and database, compatible with all other major office suites like Microsoft Office (97-2007... en.kioskea.net/telecharger/telecharger-56-openoffice
Spreadsheets - Cell Selection Spreadsheets are powerful tools for working with data. However, to work with data, it is necessary to have tools to rapidly choose the required cells. An entire line can be chosen by clicking directly on the line header: It is also possible to choose... en.kioskea.net/tableur/tabcellselect-1.php3
Spreadsheets - The Excel Interface Microsoft Excel is the spreadsheet in the Microsoft Office office suite. To start it, simply click on the appropriate icon in the Start menu (in Windows) or click on an Excel file (that has an .xls file extension). A Excel document is called a file... en.kioskea.net/tableur/tabinterface.php3
Spreadsheet - Text Operators Spreadsheets generally use an oeprator, called a concatenation operator , that allows two text values to be added together. The concatenation operator, written as &, is used as follows: In the above example, the cell value B15 ("Total TTC") is... en.kioskea.net/tableur/tabtexte.php3