Using Formulas and Functions in Microsoft Excel 2013

  • 4/15/2013
This chapter from Microsoft Excel 2013 Plain & Simple shows you how to work with formulas and functions in Microsoft Excel 2013.

In this section:

Microsoft Excel 2013 workbooks let you do much more than simply store and organize your data. One important task that you can perform in Excel is to summarize the values in related cells. Whether those cells represent the sales for a day at your store, the returns from your personal investments, or your times in bicycle races, you can find the total or average of the values, identify the minimum or maximum value in a group, or perform dozens of other calculations on your data. Many times you can’t access the information that you want without referencing more than one cell; it’s also often true that you’ll use the data in the same group of cells in more than one calculation. Excel makes it easy to reference a number of cells at once, letting you build your calculations quickly.

Creating simple cell formulas

Building calculations in Excel is pretty straightforward. If you want to find the sum of the values in two cells, you just type an equal sign (=), the reference of the first cell, a plus sign (+), and the reference of the second cell. The formula that you enter appears on the formula bar, where you can examine and edit it.

Build a formula

  1. Click the cell in which you want to enter a formula.

  2. Type =.

  3. Type the expression representing the calculation that you want to perform.

    httpatomoreillycomsourcemspimages1602903.jpg
  4. Press Enter.

Edit a formula

  1. Click the cell that you want to edit.

  2. Select the part of the formula that you want to edit in the formula bar.

    httpatomoreillycomsourcemspimages1602905.jpg
  3. Make any changes that you want.

  4. Press Enter.

Understanding formulas and cell references in Excel

When you build a formula, you need to identify the worksheet cells that provide the values for the formula and the operations that you want to perform on those values. To identify a cell, you give its cell a reference. The first cell in the first column is cell A1, meaning column A, row 1. If you examine a formula, you sometimes see a cell reference written as $A$1, rather than just A1. The difference is that cell references written with the dollar signs are absolute references, meaning that the reference doesn’t change when the formula is copied to another cell. Cell references written without the dollar signs are relative references, which do change when the formula with the reference is copied to another cell.

The benefit of relative references is that you can write a formula once, copy it to as many other cells as you like, and have Excel update the formulas to reflect the new cells. For example, consider the worksheet in the following figure, which tracks the number of hourly package pickups for a month.

The cells in column P contain formulas that calculate the sum of the hourly pickup values in column C through column O. The formula in cell P5, =SUM(C5:O5), finds the sum of cells in row 5, corresponding to January 1. When you copy the formula from cell P5 to cell P6, the formula changes to =SUM(C6:O6). Excel notices that you copied the formula to a new row and assumes that you want the formula to work on that data. Had you written the formula as =SUM($C$5:$O$5), however, Excel would notice that the formula used absolute references and would copy the formula as =SUM($C$5:$O$5).

If you want to reference a value from a cell in another workbook, you can do that. Excel uses 3D references, which means that any cell in any workbook can be described by three pieces of information: the name of the workbook, the name of the worksheet, and the cell reference.

Here’s the reference for cell Q38 on the January worksheet in the Y2013ByMonth workbook:

[Y2013ByMonth.xlsx]January!$Q$38

The good news is that you don’t need to remember how to create these references yourself. If you want to use a cell from another workbook in a formula, all that you need to do is click the cell where you want to use the value, start the formula, and then click the cell in the other workbook. Excel fills in the reference for you.