Excel Formulas and Functions
Excel Formulas and Functions
com
Table of Contents
Excel 2010 Formulas & Functions ……………………………………………….….. 2
o Formula Basics ……………………………………………….….. 2
o Order of Operation ……………………………………………….….. 2
Conditional Formatting ……………………………………………….….. 2
Cell Styles ……………………………………………….….. 4
Formulas & Functions ……………………………………………….….. 4
Basic Formulas ……………………………………………….….. 5
o Add the Values in Rows or Columns ……………………………………………….….. 5
o Find the Average, Maximum, or Minimum ……………………………………………….….. 5
Ranges & Individual Cells ……………………………………………….….. 6
Copy a Formula ……………………………………………….….. 6
o Using the Fill Handle ……………………………………………….….. 6
o Using Traditional Copy & Paste ……………………………………………….….. 6
Referencing Cells in Formulas ……………………………………………….….. 6
o Relative References ……………………………………………….….. 7
o Absolute References ……………………………………………….….. 7
o Mixed References ……………………………………………….….. 7
o References to Other Worksheets ……………………………………………….….. 7
o Other Workbook References ……………………………………………….….. 8
Quick Reference Guide ……………………………………………….….. 8
o Add, Subtract, Multiple & Divide ……………………………………………….….. 8
o Understanding Error Values ……………………………………………….….. 8
Practical Purposes of Excel Formulas ……………………………………………….….. 8
o Using Date & Time Formulas ……………………………………………….….. 9
Commonly Used Functions & Formulas ……………………………………………….….. 10
o Math & Trig Icon ……………………………………………….….. 10
Logical Icon ……………………………………………….….. 11
Lookup & Reference Icon ……………………………………………….….. 12
Date & Time Icon ……………………………………………….….. 12
AutoSum Icon ……………………………………………….….. 14
Statistical Icon ……………………………………………….….. 14
Formula Basics
Formulas in Microsoft Excel begin with an equal sign. The equal sign tells Excel that the succeeding
characters constitute a formula. If you don't enter the equal sign, Excel will treat your entry as text and
the calculation will fail.
To show how formulas work, we'll begin with a simple exercise by selecting blank cell A1. Then type
=5+5, and press Enter. Excel performs the calculation and produces a result of 10 in cell A1.
Notice the formula bar shows the formula you just typed. What appears in the cell is the result; what
appears in the formula bar is the underlying value, which is a formula in this case.
Order of Operation
When you click on Highlight Cell Rules this method will keep the cells “inactive” until the values
(numeric or text) contain the specific
rule you select. You have the option to
select: Greater Than, Less Than
Between, Equal To, Text that Contains,
A Date Occurring, and Duplicate
Values. Once you have selected a rule a
dialog box will appear where you may
specify the appropriate criteria.
Note: Within the dialog box the dropdown arrow will display numerous options of how the information
will appear.
Cell Styles
In addition to formatting the contents of the cells we can also format the appearance of the cells. Go to
the Home Tab, and locate Cell Styles
Tip: Observe the numbers in the bordered cells have been altered to currency.
With the new Excel Formula Bar the majority of all formulas you may need are at your fingertips. For
example: a Math professor is interested in determining which formula would be best to convert radians
to degrees. We will go to the Formula Tab, and select the Math & Trig downward arrow.
Tip: When you scroll the mouse over a formula Excel will have a small dialog box that explains the
purpose of each formula.
Basic Formulas
Add the Values in Rows or Columns
Use the SUM function, which is prewritten formula, to add all the values in a row or column:
1. Click your mouse in the cell in which you wish your result to appear
2. Click the AutoSum button on the Home Tab or the Formulas Tab
3. Highlight the range of cells you wish to add
4. Press Enter
1. Click your mouse in the cell in which you wish your result to appear
2. Click the arrow next to AutoSum on the Home Tab or the Formulas Tab.
3. Click the Average, Max, or Min
4. Highlight the range of cells you wish to find the value for
5. Press Enter
To see more functions, click More Functions on the AutoSum list to open the Insert Function dialog box
OR go to the Formulas Tab and click on the More Functions orange textbook icon.
Tip: You can also enter formulas and cell references by typing them in the formula bar after selecting a
cell.
Nonadjacent cells can be listed in the formula by separating them with a comma rather than a colon. For
example, =SUM(A2,A4) will add cells A2 and A4, but not A3.
Copy a Formula
Using the Fill Handle
1. Select the cell that contains the formula, then position the mouse pointer over the lower-right
corner of the cell until the black cross (+) appears.
2. Drag the fill handle over the cell or cells to which you want to copy the formula, then release the
mouse button.
To see how this works, enter 10 in cell A1. Now select cell A2 Column & Row Absolute ($A$1)
and type =A1*2, and press ENTER. The value in cell A2 is 20. If Column Absolute ($A1)
you change the value in cell A1 from 10 to any value, the value Row Absolute (A$1)
in cell A2 will also change. Cell references are especially helpful Nothing Absolute (A1)
when you create complex formulas, or conduct what-if analysis.
Pressing [F4] repeatedly over a reference (cell) will allow you to switch between making the column, the
row, or nothing ‘Absolute.’
Relative References
By default Excel uses Relative Referencing. In relative reference, you actually refer to cell that is above
or below or left or right to a number of rows or columns. For example, if you refer to cell D2 from F2,
you are actually referring to a column that is two columns to the left of cell D2 and in the same row (the
second ‘2’row). When a formula that possesses a relative reference is copied from one cell to another
cell, the value in the copied cell also changes. i.e., if you copy a formula =C2+D2 from E2 to the cell F2,
the formula in F2 adjusts in such a way that when the cell F2 is dragged downwards by one row, the
formula automatically changes to C3+D3 and places the resulting value of C3+D3 in cell F3.
Absolute References
In case, if you wish to maintain the original references as they were, then you should make use of the
absolute references. If you want to make the above example retain the original reference when it is
copied, then you should precede the columns A2 and B2 and the row number by a Dollar ($) symbol. i.e.,
you should use the formula as =$C$2+$B$2 so that when you copy the formula the original reference is
retained.
To make the cell appear in absolute format ($) click on the cell you would like to edit and press [F4] and
press enter. You will observe the cell A1 turn into =$A$1.
For example, if you copy or fill an absolute reference in cell B2 to cell B3, it stays the same in both cells
=$A$1.
Mixed References
In some situations, you may need to make the cell reference as ‘Mixed’ reference, so that you can lock
either a column or a row by preceding it with a Dollar ($) symbol. For example, if you use a formula as
=$D4+E4, then you are making the value that is present in cell D4 as absolute and the value in cell E4 as
Relative.
You can refer to cells in other worksheets within the same workbook just as easily as you refer to cells in
the same worksheet. For example, to enter a reference to cell A2 in Sheet2 into cell A1 in Sheet1, do
this:
After you press Enter, Sheet1 is now active. Select cell A1, and you will see that it contains the formula
=Sheet2!A2.
The exclamation point separates the worksheet portion of the reference from the cell portion.
You can refer to cells in worksheets in other workbooks in the same way you refer to cells in other
worksheets within the same workbook. These references are called external references. For example, to
enter a reference to Book2 in Book1, follow these steps:
After you press enter, your formula in Workbook 1, Cell A1, should be =[Book2]Sheet1!$A$2. This
reference has 3 parts: The Workbook Book2 in square brackets, the worksheet and the cell. So
referencing cells in external workbooks by selecting the workbook, then worksheet, and then the cell
you want to reference.
Type an equal sign (=), use math operators, and then press ENTER.
=10+5 to add
=10-5 to subtract
=10*5 to multiply
=10/5 to divide
Formulas are visible in the formula bar when you select a cell that contains a result. If the
formula bar is not visible, on the Tools menu, click Options. Click the View tab, and select the Formula
bar check box.
##### The column is not wide enough to display the content. Increase column width,
shrink contents to fit the column, or apply a different number format.
#REF! A cell reference is not valid. Cells may have been deleted or pasted over.
#NAME? You may have misspelled a function name.
examples of some common ways Excel formulas may be applied into your daily activities. Additional
formulas will be described in detail later on in the tutorial.
PRODUCT Function
The PRODUCT function provides a quick way to multiple numbers in a Excel. The advantage of using this
function becomes apparent if you have several numbers to multiply together. It is easier then building a
long formula.
The syntax for the PRODUCT function is: =PRODUCT( Number1, Number2, ... Number255 )
SUMIF Function
The SUMIF function is used to add up the values in cells in a selected range that meet certain criteria.
The syntax for the SUMIF function is: = SUMIF (Range, Criteria, Sum Range)
Range - the group of cells the function is to search.
Criteria - determines whether the cell is to be counted or not.
Sum Range - the data range that is summed if the first range meets the specified criteria. If this
range is omitted, the first range is summed instead.
SUMIFS Function
The SUMIFS function adds up the data in selected cells when specific criteria are met in two or more
ranges of data.
The SUMIFS function works like the AND function in that it only sums the data if the criterion for each
range is true.
The syntax for the SUMIFS function is: =SUMIFS ( Sum_range, Criteria_range1, Criteria1,
Criteria_range2, Criteria2, ...)
Sum_range - the range of cells to be added.
Criteria_range - the range of cells the function is to search.
ROUND Function
The ROUND function is used to reduce a given value to a specific number of decimal places.
The syntax for the ROUND function is: = ROUND ( Number, Num_digits )
Number - the value to be rounded.
Num_digits - the number of decimal places to reduce the above number to.
ROUNDOWN Function
The ROUNDDOWN function is used to round a number down towards the next lowest number.
ROUNDDOWN is similar to the ROUND function except that it always rounds a number downward while
the ROUND function will round up or down depending on whether the last digit is greater than or less
than 5.
For example, the ROUND function would round the number 34.567 up to 34.6 because the second
decimal place (6) is greater than 5. Since ROUNDDOWN doesn't care whether the second digit is greater
or less than 5 it rounds the answer down to 34.5.
The syntax for the ROUNDDOWN function is: = ROUNDDOWN ( Number, Num_digits )
Number - the value to be rounded.
Num_digits - the number of decimal places to reduce the above number to.
ROUNDUP Function
The ROUNDUP function is used to round a number upwards towards the next highest number.
ROUNDUP is similar to the ROUND function except that it always rounds a number upward while the
ROUND function will round up or down depending on whether the last digit is greater than or less than
5.
For example, the ROUND function would round the number 34.231 down to 34.2 because the second
decimal place (3) is less than 5. Since ROUNDUP doesn't care whether the second digit is greater or less
than 5 it rounds the answer up to 34.3.
The syntax for the ROUNDUP function is: = ROUNDUP ( Number, Num_digits )
Number - the value to be rounded.
Num_digits - the number of decimal places to reduce the above number to.
Logical Icon
IF Function
The IF function, one of Excel’s logical functions, tests to see if a certain condition in a spreadsheet is true
or false.
The syntax for the IF function is: =IF ( logical_test, value_if_true, value_if_false )
logical_test – a value or expression that is tested to see if it is true or false.
value_if_true – the value that is displayed if logical_test is true.
VLOOKUP Function
Excel's VLOOKUP function, which stands for vertical lookup, is used to find specific information that has
been stored in a spreadsheet table.
Note: The data in the table should be sorted in ascending order (alphabetically A to Z).
The syntax for the VLOOKUP function is: = VLOOKUP ( lookup_value , table_array , col_index_num ,
range_lookup )
lookup _value: The value you want to find in the first column of the table_array.
table_array: This is the table of data that VLOOKUP searches to find the information you are
after.
The table_array must contain at least two columns of data. The first column contains the lookup_values.
col_index_num: The number of the column in the table_array that contains the data you want
returned.
range_lookup: A logical value (TRUE or FALSE only) that indicates whether you want VLOOKUP
to find an exact or an approximate match to the lookup_value. Typing False will return exact
matches only.
TRANSPOSE Function
The TRANSPOSE function, one of Excel's Lookup & Reference functions, is used to copy data located in a
row into a column or copy data located in a column into a row.
The syntax for the TRANSPOSE function is: { = TRANSPOSE ( Array )}
Array - the range of cells to be copied from the horizontal to the vertical or vertical to the
horizontal.
The curly braces " { } " surrounding the function indicate that it is an array function.
NETWORKDAYS Function
The NETWORKDAYS function, one of Excel's Date and Time functions, can be used to count the number
of working days between two dates - such as the start and end dates for a project. The function
automatically removes weekend days from the total. Specific holidays can also be omitted.
The syntax for the NETWORKDAYS function is: = NETWORKDAYS ( Start_date , End_date , Holidays )
Start_date - the start date of the chosen time period.
End_date - the end date of the chosen time period.
Holidays - can be used to exclude one or more dates from the total number of working days
(optional).
DATEDIF Function
The DATEDIF function can be used to calculate the number of days between two dates in versions of
Excel from 97 to 2010. An interesting point about DATEDIF is that it is an "undocumented" function
which means it is not listed with other functions under the Formulas tab in Excel 2010.
To use the function you must type it manually into a cell on the worksheet rather than using the dialog
box method available for other functions. The syntax for the DATEDIF function is: = DATEDIF (
start_date , end_date , unit )
The function has three arguments that need to be entered as part of the function:
start_date - the first or starting date.
end_date - the second or last date.
unit - tells the function to find the number of days ("D"), complete months ("M"), or complete
years ("Y") between the two dates.
The unit argument can also be a combination of days, months, and years:
"YM" - excludes years - calculates the number of months between two dates as if the dates were
in the same year.
"YD" - excludes years - calculates the number of days between two dates as if the dates were in
the same year.
"MD" - excludes months - calculates the number of days between two dates as if the dates were
in the same month and year.
Note: The Method can be omitted. If it is, the U.S. method is used in the calculations.
WORKDAY Function
The WORKDAY function can be used to calculate the end date or start date of a project for a given
number of business days. The number of business days cannot include weekend days. Specific holidays
can also be omitted.
The syntax for the WORKDAY function is: = WORKDAY ( Start_date , Days , Holidays )
Start_date - the start date of the project or time period in question.
Days - the number of days work on the project occurred after the Start_date.
Holidays - can be used to exclude one or more dates from the total number of working days
(optional).
NOW Function
The NOW function, one of Excel's date and time functions, is used to add the current time and date to a spreadsheet.
The syntax for the NOW function is: = NOW ( )
AutoSum
AVERAGE Function
The AVERAGE function, one of Excel's statistical functions, is used to find the average or arithmetic
mean of a given list of arguments. The syntax for the AVERAGE function is: = AVERAGE ( argument1,
argument2, ... argument255 ) Argument1, argument 2, ... argument 255 can be numbers, named
ranges, arrays, or cell references.
MAX Function
The MAX function, one of Excel's statistical functions, is used to find the largest or maximum number in
a given list of values or arguments. The syntax for the MAX function is: =MAX( argument1, argument2,
... argument30 )
Argument1 ... argument 30: The arguments can be numbers, named ranges, arrays, or cell references.
Up to 30 arguments can be entered.
MIN Function
The MIN function, one of Excel's statistical functions, is used to find the smallest or minimum value in a
list of numbers or arguments. The syntax for the MIN function is: =MIN ( argument1, argument2, ...
argument30 )
Argument1 ... argument 30: Arguments can be numbers, named ranges, arrays, or cell references. Up to
30 arguments can be entered.
Statistical
AVERAGEIF Function
The AVERAGE IF function is used to find the average of values in cells in a selected range that meet
certain criteria.
The syntax for the AVERAGE IF function is: =AVERAGEIF( Range, Criteria, Sum Range)
Range - the group of cells the function is to search.
Criteria - the number, expression, or text statement that the data in the Range above is to
determines whether the cell is to be counted or not.
Average_range - the data range that is averaged if the first range meets the specified criteria. If
this range is omitted, the first range is averaged instead.
COUNTIF Function
The COUNTIF function, one of Excel's COUNT functions, is used to count up the number of cells in a
selected range that meet specified criteria. The syntax for the COUNTIF function is: =COUNTIF ( Range,
Criteria)
Range - the group of cells the function is to search.
Criteria - determines whether the cell is to be counted or not. This can be a number, expression,
cell reference, or text string.
COUNTIFS Function
The COUNTIFS function, similar to Excel's COUNTIF function, counts up the number of times data in two
or more ranges of cells meets multiple criterion.
The syntax for the COUNTIFS function is: =COUNTIFS( Criteria_range-1, Criteria-1, Criteria_range-2,
Criteria-2, ...)
Criteria_range - the group of cells the function is to search.
Criteria - determines whether the cell is to be counted or not.
COUNT Function
Excel's COUNT function is one of a group of Count Functions that can be used when you need to total
the number of cells in a selected range. The COUNT function's job is to only add up the cells in a selected
range that contain numbers. It ignores empty cells or those contain text. If a number is later added to an
empty cell the function will be automatically updated to include this new data.
Be aware that dates, times, functions, and formulas are stored as numbers in Excel. The COUNT function
will, therefore, include any cells containing these types of data in the total.
The syntax for the COUNT function is: =COUNT( Range )
Range - the group of cells the function is to count.
COUNTA Function
Excel’s COUNTA function is one of a group of “Count Functions” that can be used when you need to total the number
of cells in a selected range. The COUNTA function's job is to add up the cells in a selected range that contain numbers,
dates, or text labels. It ignores empty cells.
COUNTBLANK Function
The COUNTBLANK function, one of Excel's COUNT functions, is used to count up the number of blank
cells in a selected range.
MEDIAN Function
The MEDIAN function, one of Excel's statistical functions, shows you the middle number in a data list.
Middle, in this case, refers to arithmetic value rather than the location of the numbers in a list.
If there is an even set of numbers, the median is the average of the middle two values.
The syntax for the MEDIAN function is: = MEDIAN ( number1, number2, ... number255 )
number1, ... number255: means that up to 255 numbers can be entered into the function. These can be
numbers or the cell references where the data is located.
MODE.SNGL Function
In Excel 2010, the MODE.SNGL function, has replaced the MODE function found in previous versions of
Excel.
Despite its new name, MODE.SNGL still does the same job which is to show you the most frequently
occurring value in a list of numbers. The syntax for the MODE.SNGL function is: = MODE.SNGL (
number1, number2, ... number255 )