Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
200 views

Excel Formulas

The document provides information about Excel formulas and functions. It explains that formulas begin with an equal sign and are displayed in the formula bar. Common mathematical operations like addition, subtraction, multiplication, and division can be used in formulas. Functions are predefined formulas that perform calculations and are already available in Excel. Examples show how to enter, copy, and edit formulas and how to use functions like SUM, COUNT, IF, AND, and OR.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
200 views

Excel Formulas

The document provides information about Excel formulas and functions. It explains that formulas begin with an equal sign and are displayed in the formula bar. Common mathematical operations like addition, subtraction, multiplication, and division can be used in formulas. Functions are predefined formulas that perform calculations and are already available in Excel. Examples show how to enter, copy, and edit formulas and how to use functions like SUM, COUNT, IF, AND, and OR.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Excel Formulas

Excel formula rules

1. Formulas are entered into cells in the same way as numbers or text.
2. The formula is displayed in the Formula bar, where it may also be easily modified (it is labelled
with the fx symbol).
3. A formula must always begin with an equal (=) sign.
4. A formula is created on the basis of mathematical rules.
5. After pressing the Enter key, Excel only displays the result in the cell and the formula in the
formula bar.

Excel formula and mathematics

We showed how to add two values in the example. We used the + sign, which is well known in
mathematics. Remaining mathematical operations use the following signs in formulas:

+......................adding
-..............subtraction
*..........multiplication
/......................divide
%.................percents
^.....................power
Relationship between cells

In this chapter, we will show how Excel can be used to make work easier. It makes our work
easier by calculating large quantities of numbers for us, without the need of entering them
manually into a calculator. If we place the calculator aside and calculate everything using the
formulas in the spreadsheet, we have significantly reduced our efforts in the future. If any
situation changes, we need only to change the data and Excel calculates everything
automatically. If we rely on a calculator, we would have to calculate everything from the
beginning.

Assume that we are a car salesman and we create the following table, which we will also apply
in the following examples (therefore, save it):

Example:

The end of the quarter is approaching and our boss asks us for the sales results of individual car
models. Specifically then, how much cars of each model were sold over the last quarter.

First, we calculate the sales of Ford vehicles for the months of January + February + March, and
we enter the result in cell E2:

1. We click on cell E2 (selection indicated by bold frame).


2. We write the formula =B2+C2+D2.
3. After pressing the Enter key, the formula is calculated and the value 160 appears in cell E2.
Copying a formula within the table

Our table is finished. The first formula for calculating the sales of Ford vehicles is also finished.
Now we only need to finish the sales for the remaining vehicles. Here is where Excel makes the
work easier. We do not need to enter the formula for each vehicle separately; instead, we only
copy the formula for Ford vehicles into the fields of remaining vehicles:

1. Click on the cell E2.


2. The cell border is displayed in bold, and a small box appears in its bottom right corner. We click
on the box twice, and the formula calculates the result also for the other rows.

If we only wish to calculate certain rows, then we only click once on the box while holding the
button and dragging the mouse into the row we select. We then release the button, and the
formula is calculated.

Formulas and Functions


A formula is an expression which calculates the value of a cell. Functions are predefined
formulas and are already available in Excel.

For example, cell A3 below contains a formula which adds the value of cell A2 to the value of
cell A1.
For example, cell A3 below contains the SUM function which calculates the sum of the range
A1:A2.

Enter a Formula

To enter a formula, execute the following steps.

1. Select a cell.

2. To let Excel know that you want to enter a formula, type an equal sign (=).

3. For example, type the formula A1+A2.

Tip: instead of typing A1 and A2, simply select cell A1 and cell A2.

4. Change the value of cell A1 to 3.


Excel automatically recalculates the value of cell A3. This is one of Excel's most powerful
features!

Edit a Formula

When you select a cell, Excel shows the value or formula of the cell in the formula bar.

1. To edit a formula, click in the formula bar and change the formula.

2. Press Enter.
Operator Precedence

Excel uses a default order in which calculations occur. If a part of the formula is in parentheses,
that part will be calculated first. It then performs multiplication or division calculations. Once
this is complete, Excel will add and subtract the remainder of your formula. See the example
below.

First, Excel performs multiplication (A1 * A2). Next, Excel adds the value of cell A3 to this
result.

Another example,

First, Excel calculates the part in parentheses (A2+A3). Next, it multiplies this result by the value
of cell A1.

Copy/Paste a Formula

When you copy a formula, Excel automatically adjusts the cell references for each new cell the
formula is copied to. To understand this, execute the following steps.

1. Enter the formula shown below into cell A4.


2a. Select cell A4, right click, and then click Copy (or press CTRL + c)...

...next, select cell B4, right click, and then click Paste under 'Paste Options:' (or press CTRL +
v).

2b. You can also drag the formula to cell B4. Select cell A4, click on the lower right corner of
cell A4 and drag it across to cell B4. This is much easier and gives the exact same result!

Result. The formula in cell B4 references the values in column B.


Insert a Function

Every function has the same structure. For example, SUM(A1:A4). The name of this function is
SUM. The part between the brackets (arguments) means we give Excel the range A1:A4 as
input. This function adds the values in cells A1, A2, A3 and A4. It's not easy to remember which
function and which arguments to use for each task. Fortunately, the Insert Function feature in
Excel helps you with this.

To insert a function, execute the following steps.

1. Select a cell.

2. Click the Insert Function button.

The 'Insert Function' dialog box appears.

3. Search for a function or select a function from a category. For example, choose COUNTIF
from the Statistical category.
4. Click OK.

The 'Function Arguments' dialog box appears.

5. Click in the Range box and select the range A1:C2.

6. Click in the Criteria box and type >5.

7. Click OK.
Result. Excel counts the number of cells that are higher than 5.

Note: instead of using the Insert Function feature, simply type =COUNTIF(A1:C2,">5"). When
you arrive at: =COUNTIF( instead of typing A1:C2, simply select the range A1:C2.

Functions
Discover how functions in Excel help you save time. If you are new to functions in Excel, we recommend
you to read our introduction to Formulas and Functions first.

1 Count and Sum: The most used functions in Excel are the functions that count and sum. You
can count and sum based on one criteria or multiple criteria.

2 Logical: Learn how to use Excel's logical functions such as the IF, AND and OR function.

3 Cell References: Cell references in Excel are very important. Understand the difference
between relative, absolute and mixed reference, and you are on your way to success.

4 Date & Time: To enter a date in Excel, use the "/" or "-" characters. To enter a time, use the ":"
(colon). You can also enter a date and a time in one cell.

5 Text: Excel has many functions to offer when it comes to manipulating text strings.

6 Lookup & Reference: Learn all about Excel's lookup & reference functions such as the
VLOOKUP, HLOOKUP, MATCH, INDEX and CHOOSE function.

7 Financial: This chapter illustrates Excel's most popular financial functions.

8 Statistical: An overview of some very useful statistical functions in Excel.

9 Round: This chapter illustrates three functions to round numbers in Excel. The ROUND,
ROUNDUP and ROUNDDOWN function.

10 Formula Errors: This chapter teaches you how to deal with some common formula errors in
Excel.
11 Array Formulas: This chapter helps you understand array formulas in Excel. Single cell array
formulas perform multiple calculations in one cell.

Count and Sum Functions

The most used functions in Excel are the functions that count and sum. You can count and sum
based on one criteria or multiple criteria.

Count

To count the number of cells that contain numbers, use the COUNT function.

Countif

To count cells based on one criteria (for example, higher than 9), use the following COUNTIF
function.
Countifs

To count cells based on multiple criteria (for example, green and higher than 9), use the
following COUNTIFS function.

Sum

To sum a range of cells, use the SUM function.

Sumif

To sum cells based on one criteria (for example, higher than 9), use the following SUMIF
function (two arguments).
To sum cells based on one criteria (for example, green), use the following SUMIF function
(three arguments, last argument is the range to sum).

Sumifs

To sum cells based on multiple criteria (for example, blue and green), use the following SUMIFS
function (first argument is the range to sum).
General note: in a similar way, you can use the AVERAGEIF and AVERAGEIFS function to
average cells based on one or multiple criteria.

Logical Functions
Learn how to use Excel's logical functions such as the IF, AND and OR function.

If Function

The IF function checks whether a condition is met, and returns one value if TRUE and another
value if FALSE.

1. Select cell C2 and enter the following function.

The IF function returns Correct because the value in cell A1 is higher than 10.

And Function

The AND Function returns TRUE if all conditions are true and returns FALSE if any of the
conditions are false.

1. Select cell D2 and enter the following formula.

The AND function returns FALSE because the value in cell B2 is not higher than 5. As a result
the IF function returns Incorrect.

Or Function

The OR function returns TRUE if any of the conditions are TRUE and returns FALSE if all
conditions are false.
1. Select cell E2 and enter the following formula.

The OR function returns TRUE because the value in cell A1 is higher than 10. As a result the IF
function returns Correct.

General note: the AND and OR function can check up to 255 conditions.

Cell References
Cell references in Excel are very important. Understand the difference between relative, absolute
and mixed reference, and you are on your way to success.

Relative Reference

By default, Excel uses relative reference. See the formula in cell D2 below. Cell D2 references
(points to) cell B2 and cell C2. Both references are relative.

1. Select cell D2, click on the lower right corner of cell D2 and drag it down to cell D5.
Cell D3 references cell B3 and cell C3. Cell D4 references cell B4 and cell C4. Cell D5
references cell B5 and cell C5. In other words: each cell references its two neighbors on the left.

Absolute Reference

See the formula in cell E3 below.

1. To create an absolute reference to cell H3, place a $ symbol in front of the column letter and
row number of cell H3 ($H$3) in the formula of cell E3.

2. Now we can quickly drag this formula to the other cells.

The reference to cell H3 is fixed (when we drag the formula down and across). As a result, the
correct lengths and widths in inches are calculated.
Mixed Reference

Sometimes we need a combination of relative and absolute reference (mixed reference).

1. See the formula in cell F2 below.

2. We want to copy this formula to the other cells quickly. Drag cell F2 across one cell, and look
at the formula in cell G2.

Do you see what happens? The reference to the price should be a fixed reference to column B.
Solution: place a $ symbol in front of the column letter of cell B2 ($B2) in the formula of cell
F2. In a similar way, when we drag cell F2 down, the reference to the reduction should be a fixed
reference to row 6. Solution: place a $ symbol in front of the row number of cell B6 (B$6) in the
formula of cell F2.

Result:
Note: we don't place a $ symbol in front of the row number of B2 (this way we allow the
reference to change from B2 (Jeans) to B3 (Shirts) when we drag the formula down). In a similar
way, we don't place a $ symbol in front of the column letter of B6 (this way we allow the
reference to change from B6 (Jan) to C6 (Feb) and D6 (Mar) when we drag the formula across).

3. Now we can quickly drag this formula to the other cells.

The references to column B and row 6 are fixed.

Date & Time Functions


To enter a date in Excel, use the "/" or "-" characters. To enter a time, use the ":" (colon). You
can also enter a date and a time in one cell.
Note: Dates are in US Format. Months first, Days second. This type of format depends on your
windows regional settings. Learn more about Date and Time formats.

Year, Month, Day

To get the year of a date, use the YEAR function.

Note: use the MONTH and DAY function to get the month and day of a date.

Date Function

1. To add a number of days to a date, use the following simple formula.

2. To add a number of years, months and/or days, use the DATE function.

Note: the DATE function accepts three arguments: year, month and day. Excel knows that 6 + 2
= 8 = August has 31 days and rolls over to the next month (23 August + 9 days = 1 September).

Current Date & Time

To get the current date and time, use the NOW function.
Note: use the TODAY function to get the current date only. Use NOW()-TODAY() to get the
current time only (and apply a Time format).

Hour, Min, Sec

To return the hour, use the HOUR function.

Note: use the MINUTE and SECOND function to return the minute and second.

Time Function

To add a number of hours, minutes and/or seconds, use the TIME function.

Note: Excel adds 2 hours, 10 + 1 = 11 minutes and 70 - 60 = 10 seconds.

Text Functions
Join Strings

To join strings, use the & operator.


Left

To extract the leftmost characters from a string, use the LEFT function.

Right

To extract the rightmost characters from a string, use the RIGHT function.

Mid

To extract a substring, starting in the middle of a string, use the MID function.

Note: started at position 5 (p) with length 3.

Len

To get the length of a string, use the LEN function.


Note: space (position 8) included!

Find

To find the position of a substring in a string, use the FIND function.

Note: string "am" found at position 3.

Substitute

To replace existing text with new text in a string, use the SUBSTITUTE function.

Lookup & Reference Functions


VLookup

The VLOOKUP (Vertical lookup) function looks for a value in the leftmost column of a table,
and then returns a value in the same row from another column you specify.

1. Insert the VLOOKUP function shown below.


Explanation: the VLOOKUP function looks for the ID (104) in the leftmost column of the range
$E$4:$G$7 and returns the value in the same row from the third column (third argument is set to
3). The fourth argument is set to FALSE to return an exact match or a #N/A error if not found.

2. Drag the VLOOKUP function in cell B2 down to cell B11.

Note: when we drag the VLOOKUP function down, the absolute reference ($E$4:$G$7) stays
the same, while the relative reference (A2) changes to A3, A4, A5, etc.

HLookup

In a similar way, you can use the HLOOKUP (Horizontal lookup) function.
Match

The MATCH function returns the position of a value in a given range.

Note: Yellow found at position 3 in the range E4:E7. The third argument is optional. Set this
argument to 0 to return the position of the value that is exactly equal to lookup_value (A2) or a
#N/A error if not found.

Index

The INDEX function returns a specific value in a two-dimensional or one-dimensional range.


Note: 92 found at the intersection of row 3 and column 2 in the range E4:F7.

Note: 97 found at position 3 in the range E4:E7.

Choose

The CHOOSE function returns a value from a list of values, based on a position number.

Note: Boat found at position 3.


Financial Functions
To illustrate Excel's most popular financial functions, we consider a loan with monthly
payments, an annual interest rate of 6%, a 20-year duration, a present value of $150,000 (amount
borrowed) and a future value of 0 (that's what you hope to achieve when you pay off a loan).

We make monthly payments, so we use 6%/12 = 0.5% for Rate and 20*12 = 240 for Nper (total
number of periods). If we make annual payments on the same loan, we use 6% for Rate and 20
for Nper.

Pmt

Select cell A2 and insert the PMT function.

Note: The last two arguments are optional. For loans the Fv can be omitted (the future value of a
loan equals 0, however, it's included here for clarification). If Type is omitted, it is assumed that
payments are due at the end of the period.

Result. The monthly payment equals $1,074.65.

Tip: when working with financial functions in Excel, always ask yourself the question, am I
making a payment (negative) or am I receiving money (positive)? We pay off a loan of $150,000
(positive, we received that amount) and we make monthly payments of $1,074.65 (negative, we
pay).

Rate

If Rate is the only unknown variable, we can use the RATE function to calculate the interest rate.
Nper

Or the NPER function. If we make monthly payments of $1,074.65 on a 20-year loan, with an
annual interest rate of 6%, it takes 240 months to pay off this loan.

We already knew this, but we can change the monthly payment now to see how this affects the
total number of periods.

Conclusion: if we make monthly payments of $2,074.65, it takes less than 90 months to pay off
this loan.

Pv

Or the PV (Present Value) function. If we make monthly payments of $1,074.65 on a 20-year


loan, with an annual interest rate of 6%, how much can we borrow? You already know the
answer.
Fv

And we finish this chapter with the FV (Future Value) function. If we make monthly payments
of $1,074.65 on a 20-year loan, with an annual interest rate of 6%, do we pay off this loan? Yes.

But, if we make monthly payments of only $1,000.00, we still have debt after 20 years.

Statistical Functions
Average

To calculate the average of a range of cells, use the AVERAGE function.


Averageif

To average cells based on one criteria, use the AVERAGEIF function. For example, to calculate
the average excluding zeros.

Note: <> means not equal to. The AVERAGEIF function is similar to the SUMIF function.

Median

To find the median (or middle number), use the MEDIAN function.

Check:

Mode

To find the most frequently occurring number, use the MODE function.
Standard Deviation

To calculate the standard deviation, use the STEDV function.

Min

To find the minimum value, use the MIN function.

Max

To find the maximum value, use the MAX function.

Large

To find the third largest number, use the following LARGE function.
Check:

Small

To find the second smallest number, use the following SMALL function.

Check:

Tip: Excel can generate most of these results with the click of a button. Our Descriptive Statistics
example shows you how.

Round
This chapter illustrates three functions to round numbers in Excel. The ROUND, ROUNDUP
and ROUNDDOWN function.

Before your start: if you round a number, you lose precision. If you don't want this, show fewer
decimal places without changing the number itself.

Round

1. Round a number to two decimal places.


Note: 1, 2, 3, and 4 get rounded down. 5, 6, 7, 8, and 9 get rounded up. In this example,
114.7211, 114.7221, 114.7231 and 114.7241 get rounded down to 114.72 and 114.7251,
114.7261, 114.7271, 114.7281 and 114.7291 get rounded up to 114.73.

2. Round a number to one decimal place.

3. Round a number to the nearest integer.

4. Round a number to the nearest 10.

5. Round a number to the nearest 100.


RoundUp

The ROUNDUP function always rounds a number up (away from zero). For example, round a
number up to one decimal place.

RoundDown

The ROUNDDOWN function always rounds a number down (toward zero). For example, round
a number down to the nearest integer.

Formula Errors
 
##### error

When your cell contains this error code, the column isn't wide enough to display the value.
1. Click on the right border of the column A header and increase the column width.

Tip: double click the right border of the column A header to automatically fit the widest cell in
column A.

#NAME? error

The #NAME? error occurs when Excel does not recognize text in a formula.

1. Simply correct SU to SUM.


#VALUE! error

Excel displays the #VALUE! error when a formula has the wrong type of argument.

1a. Change the value of cell A3 to a number.


1b. Use a function to ignore cells that contain text.

#DIV/0! error

Excel displays the #DIV/0! error when a formula tries to divide a number by 0 or an empty cell.
1a. Change the value of cell A2 to a value that is not equal to 0.
1b. Prevent the error from being displayed by using the logical function IF.

Explanation: if cell A2 equals 0, an empty string is displayed. If not, the result of the formula
A1/A2 is displayed.

#REF! error

Excel displays the #REF! error when a formula refers to a cell that is not valid.

1. Cell C1 references cell A1 and cell B1.

2. Delete column B. To achieve this, right click the column B header and click Delete.
3. Select cell B1. The reference to cell B1 is not valid anymore.

4. To fix this error, you can either delete +#REF! in the formula of cell B1 or you can undo your
action by clicking Undo in the Quick Access Toolbar (or press CTRL + z).

You might also like