Using Formulas and Functions in Excel

Enter Formula | Edit Formula | Copy & Paste Formula | Insert Function

A formula in Excel is an expression of an equation to calculate a value whereas a function is a pre-defined formula. One good thing is that we can use functions in our formula. To be specific, Excel formula can be custom made and the Excel function is pre-defined. Below are examples of both formulas and functions in Excel.

Cell B4 has a formula that adds two previous numbers in cells B2 and B3 and divides the sum by 2.

formula in excel

Cell B4 has an AVERAGE function that calculates the average of two numbers in cells B2 and B3. Note that, in both approaches, we get the same results.

function in excel

Enter a Formula

To enter a formula in a cell, do the following.

1. Select a cell that you want to write a formula in. In our example, we select cell B4.

2. Type in an equal sign (=), your formula, and then press Enter.

write formula

Note: In Excel, always write an equal sign before writing a formula or function. Typing something in a cell without starting with an equal sign does not let Excel know that you are trying to do a mathematical operation or invoke any pre-defined Excel function.

3. Once you are done typing the formula, any change in cell B2 or B3 will lead Excel to automatically recalculate the vale in cell B4.

recalculation

Edit a Formula

Here is how you can edit a formula.

1. Select the cell that contains the formula. Excel will show the associated formula in the formula bar.

edit a formula in excel

2. click in the formula bar and change it the way you want.

formula in formula bar

3. Press Enter

edited formula

Copy and Paste a Formula

1. Type a formula in a cell or select the cell containing a formula that you want to copy. We select B4.

copy a formula in excel

2. Righ-click and select copy from the menu. Keyboard shortcut: CTRL+c

click copy

3a. Select cell D4 or your target cell, right-click, and select Paste. Keyboard shortcut: CTRL+v

select paste

3b. Alternatively, select cell B4 and then drag the fill handle to the right to cell D4.

drag formula

Result: The formula from cell B4 is copied to cell D4 and the value is calculated automatically. Note that the formula is also copied to cell C4. As there is no value in cells C2 and C3, the result shows as 0.

formula copied to another cell

Insert a Function

In Excel, the structure of the function is more or less the same. If you know the function already, you can start with an equal sign (=) and write the function. Excel will auto-suggest you what function you are trying to write.

insert function in excel

However, to insert using the Excel built-in button, follow the steps below.

1. Select cell B4.

2. Click the Insert Function button.

click insert function

3. From the Insert Function dialog box, search for your function. We will find the “AVERAGE” function.

select average function

4. Click OK.

function argument dialog box

5. Click in the “Number1” box and select your range of cells using your mouse or manually type it in. For instance, we select B2:B3.

6. Click OK.

result for average function

1 of 10 finished! Recommending more on Formulas and Functions: Next Example >>
<< Previous Example | Skip to Next Chapter 07: Find and Select