Economics BFM Sem 3
Economics BFM Sem 3
One of the most powerful features in Excel is the ability to calculate numerical information
using formulas. Just like a calculator, Excel can add, subtract, multiply, and divide. In this
lesson, we'll show you how to use cell references to create simple formulas.
Mathematical operators
Excel uses standard operators for formulas, such as a plus sign for addition (+), a minus
sign for subtraction (-), an asterisk for multiplication (*), a forward slash for division (/),
and a caret (^) for exponents.
All formulas in Excel must begin with an equals sign (=). This is because the cell contains,
or is equal to, the formula and the value it calculates.
While you can create simple formulas in Excel using numbers (for example, =2+2 or =5*5),
most of the time you will use cell addresses to create a formula. This is known as making
a cell reference. Using cell references will ensure that your formulas are always accurate
because you can change the value of referenced cells without having to rewrite the formula.
In the formula below, cell A3 adds the values of cells A1 and A2 by making cell references:
When you press Enter, the formula calculates and displays the answer in cell A3:
If the values in the referenced cells change, the formula automatically recalculates:
By combining a mathematical operator with cell references, you can create a variety of
simple formulas in Excel. Formulas can also include a combination of cell references and
numbers, as in the examples below:
To create a formula:
In our example below, we'll use a simple formula and cell references to calculate a budget.
Select the cell that will contain the formula. In our example, we'll select cell D12.
Type the equals sign (=). Notice how it appears in both the cell and the formula bar.
Type the cell address of the cell you want to reference first in the formula: cell D10 in our
example. A blue border will appear around the referenced cell.
Type the mathematical operator you want to use. In our example, we'll type the addition
sign (+).
Type the cell address of the cell you want to reference second in the formula: cell D11 in
our example. A red border will appear around the referenced cell.
Press Enter on your keyboard. The formula will be calculated, and the value will be
displayed in the cell. If you select the cell again, notice that the cell displays the result, while
the formula bar displays the formula.
If the result of a formula is too large to be displayed in a cell, it may appear as pound
signs (#######) instead of a value. This means the column is not wide enough to display the
cell content. Simply increase the column width to show the cell content.
Modifying values with cell references
The true advantage of cell references is that they allow you to update data in your
worksheet without having to rewrite formulas. In the example below, we've modified the
value of cell D10 from $1,200 to $1,800. The formula in D12 will automatically recalculate
and display the new value in cell D12.
Type the mathematical operator you want to use. In our example, we'll type
the multiplication sign (*).
Select the cell you want to reference second in the formula: cell C4 in our example. The cell
address will appear in the formula.
Press Enter on your keyboard. The formula will be calculated, and the value will be
displayed in the cell.
To edit a formula:
Sometimes you may want to modify an existing formula. In the example below, we've
entered an incorrect cell address in our formula, so we'll need to correct it.
Select the cell containing the formula you want to edit. In our example, we'll select cell D12.
Click the formula bar to edit the formula. You can also double-click the cell to view and
edit the formula directly within the cell.
A border will appear around any referenced cells. In our example, we'll change the first part
of the formula to reference cell D10 instead of cell D9.
When you're finished, press Enter on your keyboard or select the Enter command in the
formula bar.
The formula will be updated, and the new value will be displayed in the cell.
If you change your mind, you can press the Esc key on your keyboard or click
the Cancel command in the formula bar to avoid accidentally making changes to your
formula.
To show all of the formulas in a spreadsheet, you can hold the Ctrl key and press ` (grave
accent). The grave accent key is usually located in the top-left corner of the keyboard. You
can press Ctrl+` again to switch back to the normal view.
Creating More Complex Formulas
You may have experience working with formulas that contain only one operator, such
as 7+9. More complex formulas can contain several mathematical operators, such
as 5+2*8. When there's more than one operation in a formula, the order of operations tells
Excel which operation to calculate first. To write formulas that will give you the correct
answer, you'll need to understand the order of operations.
The order of operations: Excel calculates formulas based on the following order
Operations enclosed in parentheses
Exponential calculations (3^2, for example)
Multiplication and division, whichever comes first
Addition and subtraction, whichever comes first
A mnemonic that can help you remember the order is PEMDAS,
or Please Excuse My Dear Aunt Sally. (Refer Order of operations in excel.pptx)
Excel follows the order of operations and first adds the values inside the
parentheses: (45.80+68.70+159.60) = 274.10. It then multiplies that value by the tax
rate: 274.10*0.075. The result will show that the sales tax is $20.56.
It's especially important to follow the order of operations when creating a formula.
Otherwise, Excel won't calculate the results accurately. In our example, if
the parentheses are not included, the multiplication is calculated first and the result is
incorrect. Parentheses are often the best way to define which calculations will be performed
first in Excel.
Enter your formula. In our example, we'll type =B3*C3+B4*C4. This formula will follow
the order of operations, first performing the multiplication: 2.79*35 = 97.65 and 2.29*20 =
45.80. It then will add these values to calculate the total: 97.65+45.80.
Double-check your formula for accuracy, then press Enter on your keyboard. The formula
will calculate and display the result. In our example, the result shows that the subtotal for the
order is $143.45.
You can add parentheses to any equation to make it easier to read. While it won't change the
result of the formula in this example, we could enclose the multiplication operations within
parentheses to clarify that they will be calculated before the addition.
Relative and Absolute Cell References
There are two types of cell references: relative and absolute. Relative and absolute
references behave differently when copied and filled to other cells. Relative
references change when a formula is copied to another cell. Absolute references, on the
other hand, remain constant no matter where they are copied.
Relative references
By default, all cell references are relative references. When copied across multiple cells,
they change based on the relative position of rows and columns. For example, if you copy
the formula =A1+B1 from row 1 to row 2, the formula will become =A2+B2. Relative
references are especially convenient whenever you need to repeat the same calculation across
multiple rows or columns.
To create and copy a formula using relative references:
In the following example, we want to create a formula that will multiply each item's price by
the quantity. Instead of creating a new formula for each row, we can create a single formula
in cell D4 and then copy it to the other rows. We'll use relative references so the formula
calculates the total for each item correctly.
Select the cell that will contain the formula. In our example, we'll select cell D4.
Enter the formula to calculate the desired value. In our example, we'll type =B4*C4.
Press Enter on your keyboard. The formula will be calculated, and the result will be
displayed in the cell.
Locate the fill handle in the bottom-right corner of the desired cell. In our example, we'll
locate the fill handle for cell D4.
Click and drag the fill handle over the cells you want to fill. In our example, we'll select
cells D5:D13.
Release the mouse. The formula will be copied to the selected cells with relative references,
displaying the result in each cell.
You can double-click the filled cells to check their formulas for accuracy. The relative cell
references should be different for each cell, depending on their rows.
Absolute references
There may be a time when you don't want a cell reference to change when copied to other
cells. Unlike relative references, absolute references do not change when copied or filled.
You can use an absolute reference to keep a row and/or column constant.
An absolute reference is designated in a formula by the addition of a dollar sign ($). It can
precede the column reference, the row reference, or both.
You will generally use the $A$2 format when creating formulas that contain absolute
references. The other two formats are used much less frequently.
When writing a formula, you can press the F4 key on your keyboard to switch between
relative and absolute cell references, as shown in the video below. This is an easy way to
quickly insert an absolute reference.
To create and copy a formula using absolute references:
In the example below, we're going to use cell E2 (which contains the tax rate at 7.5%) to
calculate the sales tax for each item in column D. To make sure the reference to the tax rate
stays constant—even when the formula is copied and filled to other cells—we'll need to
make cell $E$2 an absolute reference.
Select the cell that will contain the formula. In our example, we'll select cell D4.
Enter the formula to calculate the desired value. In our example, we'll type
=(B4*C4)*$E$2, making $E$2 an absolute reference.
Press Enter on your keyboard. The formula will calculate, and the result will display in the
cell.
Locate the fill handle in the bottom-right corner of the desired cell. In our example, we'll
locate the fill handle for cell D4.
Click and drag the fill handle over the cells you want to fill (cells D5:D13 in our example).
Release the mouse. The formula will be copied to the selected cells with
an absolute reference, and the values will be calculated in each cell.
You can double-click the filled cells to check their formulas for accuracy. The absolute
reference should be the same for each cell, while the other references are relative to the cell's
row.
Be sure to include the dollar sign ($) whenever you're making an absolute reference across
multiple cells. The dollar signs were omitted in the example below. This caused Excel to
interpret it as a relative reference, producing an incorrect result when copied to other cells.
Using cell references with multiple worksheets
Excel allows you to refer to any cell on any worksheet, which can be especially helpful if
you want to reference a specific value from one worksheet to another. To do this, you'll
simply need to begin the cell reference with the worksheet name followed by
an exclamation point (!). For example, if you wanted to reference cell A1 on Sheet1, its cell
reference would be Sheet1!A1.
Note that if a worksheet name contains a space, you'll need to include single quotation
marks (' ') around the name. For example, if you wanted to reference cell A1 on a worksheet
named July Budget, its cell reference would be 'July Budget'!A1.
To reference cells across worksheets:
In our example below, we'll refer to a cell with a calculated value between two worksheets.
This will allow us to use the exact same value on two different worksheets without rewriting
the formula or copying data.
Locate the cell you want to reference, and note its worksheet. In our example, we want to
reference cell E14 on the Menu Order worksheet.
Navigate to the desired worksheet. In our example, we'll select the Catering
Invoice worksheet.
Locate and select the cell where you want the value to appear. In our example, we'll select
cell C4.
Type the equals sign (=), the sheet name followed by an exclamation point (!), and the cell
address. In our example, we'll type ='Menu Order'!E14.
Press Enter on your keyboard. The value of the referenced cell will appear. Now, if the
value of cell E14 changes on the Menu Order worksheet, it will be updated automatically on
the Catering Invoice worksheet.
If you rename your worksheet at a later point, the cell reference will be updated
automatically to reflect the new worksheet name.
If you enter a worksheet name incorrectly, the #REF! error will appear in the cell. In our
example below, we've mistyped the name of the worksheet. To edit, ignore, or
investigate the error, click the Error button beside the cell and choose an option from
the menu.
Functions
A function is a predefined formula that performs calculations using specific values in a
particular order. Excel includes many common functions that can be used to quickly find
the sum, average, count, maximum value, and minimum value for a range of cells. In
order to use functions correctly, you'll need to understand the different parts of a
function and how to create arguments to calculate values and cell references.
The parts of a function
In order to work correctly, a function must be written a specific way, which is called
the syntax. The basic syntax for a function is the equals sign (=), the function name (SUM,
for example), and one or more arguments. Arguments contain the information you want to
calculate. The function in the example below would add the values of the cell range A1:A20.
Creating a function
There are a variety of functions available in Excel. Here are some of the most common
functions you'll use:
1. SUM: This function adds all of the values of the cells in the argument.
2. AVERAGE: This function determines the average of the values included in the argument. It
calculates the sum of the cells and then divides that value by the number of cells in the argument.
3. COUNT: This function counts the number of cells with numerical data in the argument. This
function is useful for quickly counting items in a cell range.
4. MAX: This function determines the highest cell value included in the argument.
5. MIN: This function determines the lowest cell value included in the argument.
To create a function using the AutoSum command:
The AutoSum command allows you to automatically insert the most common functions into
your formula, including SUM, AVERAGE, COUNT, MIN, and MAX. In the example
below, we'll use the SUM function to calculate the total cost for a list of recently ordered
items.
Select the cell that will contain the function. In our example, we'll select cell D13.
In the Editing group on the Home tab, click the arrow next to the AutoSum command.
Next, choose the desired function from the drop-down menu. In our example, we'll
select Sum.
Excel will place the function in the cell and automatically select a cell range for the
argument. In our example, cells D3:D12 were selected automatically; their values will
be added to calculate the total cost. If Excel selects the wrong cell range, you can manually
enter the desired cells into the argument.
Press Enter on your keyboard. The function will be calculated, and the result will appear in
the cell. In our example, the sum of D3:D12 is $765.29.
The AutoSum command can also be accessed from the Formulas tab on the Ribbon.
You can also use the Alt+= keyboard shortcut instead of the AutoSum command. To use this
shortcut, hold down the Alt key and then press the equals sign.
Watch the video below to see this shortcut in action.
To enter a function manually:
If you already know the function name, you can easily type it yourself. In the example below
(a tally of cookie sales), we'll use the AVERAGE function to calculate the average number
of units sold by each troop.
Select the cell that will contain the function. In our example, we'll select cell C10.
Type the equals sign (=), and enter the desired function name. You can also select the
desired function from the list of suggested functions that appears below the cell as you type.
In our example, we'll type =AVERAGE.
Enter the cell range for the argument inside parentheses. In our example, we'll
type (C3:C9). This formula will add the values of cells C3:C9, then divide that value by the
total number of values in the range.
Press Enter on your keyboard. The function will be calculated, and the result will appear in
the cell. In our example, the average number of units sold by each troop is 849.
The Function Library
While there are hundreds of functions in Excel, the ones you'll use the most will depend on
the type of data your workbooks contain. There's no need to learn every single function, but
exploring some of the different types of functions will help you as you create new projects.
You can even use the Function Library on the Formulas tab to browse functions by
category, such as Financial, Logical, Text, and Date & Time.
To access the Function Library, select the Formulas tab on the Ribbon. Look for
the Function Library group.
The function will be calculated, and the result will appear in the cell. In our example, the
result shows that a total of 10 items were ordered.
The Insert Function command
While the Function Library is a great place to browse for functions, sometimes you may
prefer to search for one instead. You can do so using the Insert Function command. It may
take some trial and error depending on the type of function you're looking for; however, with
practice, the Insert Function command can be a powerful way to find a function quickly.
To use the Insert Function command:
In the example below, we want to find a function that will calculate the number of business
days it took to receive items after they were ordered. We'll use the dates in
columns E and F to calculate the delivery time in column G.
Select the cell that will contain the function. In our example, we'll select cell G3.
Click the Formulas tab on the Ribbon, then click the Insert Function command.
The Function Arguments dialog box will appear. From here, you'll be able to enter or select
the cells that will make up the arguments in the function. In our example, we'll enter E3 in
the Start_date field and F3 in the End_date field.
When you're satisfied, click OK.
The function will be calculated, and the result will appear in the cell. In our example, the
result shows that it took four business days to receive the order.
Like formulas, functions can be copied to adjacent cells. Simply select the cell that contains
the function, then click and drag the fill handle over the cells you want to fill. The function
will be copied, and values for those cells will be calculated relative to their rows or columns.