0% found this document useful (0 votes)
39 views47 pages

Lecture 2

Formulas and functions in Excel allow users to perform calculations and retrieve results. Formulas begin with an equal sign and can contain cell references, values, operators, and functions. Functions perform more complex calculations and have names indicating their use, like SUM to add values or AVERAGE to find the mean. Common functions include SUM, AVERAGE, COUNT, IF, and POWER. This document provides examples of how to create formulas using cell references and functions.

Uploaded by

073 Rohith kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views47 pages

Lecture 2

Formulas and functions in Excel allow users to perform calculations and retrieve results. Formulas begin with an equal sign and can contain cell references, values, operators, and functions. Functions perform more complex calculations and have names indicating their use, like SUM to add values or AVERAGE to find the mean. Common functions include SUM, AVERAGE, COUNT, IF, and POWER. This document provides examples of how to create formulas using cell references and functions.

Uploaded by

073 Rohith kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Formulas and Functions

LECTURE 3

1
What is the Formula in Excel?

An Excel formula is nothing but an introductory statement consisting of one or more 'operands'
and 'operators’

Formulas in Excel help us :

To specify the relationship between the values recorded within the cells

To perform mathematical calculations on the recorded values

To retrieve the desired results in a resultant cell

2
What is the Formula in Excel?

One essential point: we must always start them with an equal sign (=)

3
The Difference between a Formula and Function

There is another term that is very familiar to Excel formulas, and that is "function”

The two words, "formulas" and "functions" are sometimes interchangeable

They are closely related, but yet different

A formula begins with an equal sign

Meanwhile, functions are used to perform complex calculations that cannot be done manually

Functions in Excel have names that reflect their intended use

4
The Difference between a Formula and Function

There is another term that is very familiar to Excel formulas, and that is "function”

The two words, "formulas" and "functions" are sometimes interchangeable

They are closely related, but yet different

A formula begins with an equal sign

Meanwhile, functions are used to perform complex calculations that cannot be done manually

Functions in Excel have names that reflect their intended use

5
The Difference between a Formula and Function

Example of Formula: =A1+A2+A3

Example of Function: =SUM(A1:A3)

6
How to create a formula in Excel?

Choose a cell

To enter an equal sign, click the cell and type =

Enter the address of a cell in the selected cell or select a cell from the list

You need to enter an operator

Enter the address of the next cell in the selected cell

Press Enter

7
How to create a formula in Excel?

8
Creating Formulas Using Cell References

If the values are recorded in than two cells, we can use the cell reference of each cell similarly

For example, if we have values in cells A1, B1, and C1, we can add their corresponding values
using the formula =A1+B1+C1

However, if several cells are required in a formula, it is better to try using existing functions and
ranges of cells

9
Creating Formulas Using Cell References

10
Creating Formulas using the Pre-defined
Functions
Using the Function Wizard to create a formula:

We need to navigate the Formulas tab and click on the 'Insert Function' button under the
'Function Library' section, which will launch the 'Insert Function' window

11
Creating Formulas using the Pre-defined
Functions
we can also use the 'fx' button from the left side of the formula bar to insert the desired function
in a cell

12
Creating Formulas using the Pre-defined
Functions
In the Insert Function window:

We have to type the function name in the first option


box and click on the Go button

Additionally, we can type the desired function's


description or operation and click 'Go' to find relevant
function names

However, it is not such a convenient option if we don't


know the appropriate name of the function

13
Creating Formulas using the Pre-defined
Functions

When we are not sure of the function's name, we must manually select the category to which our
function may belong

The list has about 14-16 different categories, and all the existing Excel functions are divided into
them accordingly

14
Typing/ Writing a formula into a
Cell or formula bar
15
Excel Formulas and
Functions

There are plenty of Excel formulas and


functions depending on what kind of
operation you want to perform on the
dataset

16
SUM

The SUM() function, as the name suggests, gives the total of the selected range of cell values

It performs the mathematical operation which is addition

Sample Formula: "=SUM(C2:C4)"

17
SUMIF

We use the SUMIF function to sum the values in a range that meets the criteria that you specify

For example, suppose that in a column that contains numbers, we want to sum only the values that
are larger than 5

Sample Formula:=SUMIF(B2:B25,">5")

18
AVERAGE

The AVERAGE() function focuses on calculating the


average of the selected range of cell values

Sample Formula: “=AVERAGE(C2, C3, C4)”

It automatically calculates the average, and you


can store the result in your desired location

19
AVERAGEIF

Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria.

Sample Formula: =AVERAGEIF(range, criteria, [average_range])

The AVERAGEIF function syntax has the following arguments:

Range: Required One or more cells to average, including numbers or names, arrays, or references that
contain numbers

Criteria: Required

Average_range: Optional The actual set of cells to average; If omitted, the range is used

20
COUNT

The function COUNT() counts the total number of cells in a range that contains a number

It does not include the cell, which is blank, and the ones that hold data in any other format apart
from numeric

Sample Formula: "=COUNT(C1:C4)"

To count the number of blank cells present in a range of cells, COUNTBLANK() is used

21
COUNTA

The COUNTA function counts the number of cells that are not empty in a range

Sample Formula: "= COUNTA(value1, [value2], ...)”

22
COUNT VS. COUNTA

The COUNTA function counts cells containing any type of information, including error values and
empty text ("")

For example, if the range contains a formula that returns an empty string, the COUNTA function
counts that value

The COUNTA function does not count empty cells

If you do not need to count logical values, text, or error values, use the COUNT function

23
COUNTIF

Use COUNTIF, one of the statistical functions, to count the number of cells that meet a criterion

for example, to count the number of times a particular city appears in a customer list

In its simplest form, COUNTIF says:

=COUNTIF(Where do you want to look?, What do you want to look for?)

Sample Formula: " =COUNTIF(A2:A5,"London")”

24
SUBTOTAL

The SUBTOTAL() function returns the subtotal in a database

Depending on what you want, you can select either average, count, sum, min, max, min, and others

Sample Formula: “=SUBTOTAL(1, A2: A4)”

25
Function_num Function
(includes (ignores
hidden rows) hidden rows)
1 101 AVERAGE
2 102 COUNT
3 103 COUNTA
4 104 MAX
5 105 MIN
SUBTOTAL 6 106 PRODUCT

26
MODULUS

The MOD() function works on returning the remainder when a particular number is divided by a
divisor

Let’s now have a look at the examples below for a better understanding

Sample Formula: “=MOD(A2,3)”

Sample Formula: “=MOD(10,3)”

27
POWER

The function “Power()” returns the result of a number raised to a certain power

Sample Formula: “= POWER (A2,3)”

Sample Formula: “= POWER (5,3)”

28
CEILING

Next, we have the ceiling function

The CEILING() function rounds a number up to its nearest multiple of significance

Returns number rounded up, away from zero, to the nearest multiple of significance

29
CEILING

If either argument is non-numeric, CEILING returns the #VALUE! error value

Regardless of the sign of the number, a value is rounded up when adjusted away from zero

If the number is an exact multiple of significance, no rounding occurs

If the number is negative, and the significance is negative, the value is rounded down, away from
zero

If the number is negative, and the significance is positive, the value is rounded up towards zero

30
CEILING

Formula Description Result


=CEILING(2.5, 1) Rounds 2.5 up to nearest multiple 3
of 1
=CEILING(-2.5, -2) Rounds -2.5 up to nearest -4
multiple of -2
=CEILING(-2.5, 2) Rounds -2.5 up to nearest -2
multiple of 2
=CEILING(1.5, 0.1) Rounds 1.5 up to the nearest 1.5
multiple of 0.1
=CEILING(0.234, 0.01) Rounds 0.234 up to the nearest 0.24
multiple of 0.01

31
FLOOR

Contrary to the Ceiling function, the floor function rounds a number down to the nearest multiple of
significance

Rounds number down, toward zero, to the nearest multiple of significance

32
FLOOR

If either argument is non-numeric, FLOOR returns the #VALUE! Error value

If the number is positive and significance is negative, FLOOR returns the #NUM! error value

If the sign of the number is positive, a value is rounded down and adjusted toward zero

If the sign of the number is negative, a value is rounded down and adjusted away from zero

If the number is an exact multiple of significance, no rounding occurs

33
FLOOR

Formula Description Result


=FLOOR(3.7,2) Rounds 3.7 down to nearest 2
multiple of 2.
=FLOOR(-2.5,-2) Rounds -2.5 down to nearest -2
multiple of -2.
=FLOOR(2.5,-2) Returns an error value, because 2.5 #NUM!
and -2 have different signs.
=FLOOR(1.58,0.1) Rounds 1.58 down to the nearest 1.5
multiple of 0.1.
=FLOOR(0.234,0.01) Rounds 0.234 down to the nearest 0.23
multiple of 0.01.

34
Creating Formulas Using Defined Names

Instead of using the cell references/ ranges in the formula directly, we can also specify a desired
name for the specific cells/ range and use it later in our formula

We defined the names of cells

However, we can also define a name for the entire range, usually called Named Range

To manage (define, view, edit, or delete) any name for the cell(s) or a range, we must go to Formulas
> Name Manager

35
NOW

The NOW() function in Excel gives the current system date and time

The result of the NOW() function will change based on your system date and time

36
TODAY

The TODAY() function in Excel provides the current system date

The function DAY() is used to return the day of the month

The MONTH() function returns the month

The YEAR() function, as the name suggests, returns the year from a date value

37
TIME

The TIME() function converts hours, minutes, and seconds given as numbers to an Excel serial
number, formatted with a time format

38
HOUR, MINUTE, SECOND

The HOUR() function generates the hour from a time value as a number from 0 to 23

39
HOUR, MINUTE, SECOND

The function MINUTE(), returns the minute from a time value as a number from 0 to 59

40
DATEDIF

The DATEDIF() function provides the difference between two dates in terms of years, months, or
days

An example of a DATEDIF function is where we calculate the current age of a person based on two
given dates, the date of birth and today’s date

41
DATEDIF

Syntax: DATEDIF(start_date,end_date,unit)

start_date: A date that represents the first, or starting date of a given period

end_date: A date that represents the last, or ending, date of the period

Unit: The type of information that you want to be returned

Unit: “Y”, “M”, “D”, "MD”, "YM"

42
VLOOKUP

VLOOKUP stands for Vertical Lookup

As the name specifies, VLOOKUP is a built-in Excel function that helps you look for a specified value
by searching for it vertically across the sheet

VLOOKUP in Excel may sound complicated, but you will find out that it is a very easy and useful tool
once you try it

43
VLOOKUP

The VLOOKUP allows searches across columns

=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

Note: The column which holds the data used to lookup must always be to the left

Lookup_value: Select the cell where search values will be entered

Table_array: The table range, including all cells in the table

Col_index_num: The data which is being looked up

44
VLOOKUP

The input is the number of the column, counted from the left:

Range_lookup: TRUE if numbers (1) or FALSE if text (0)

Note: Both 1 / 0 and True / False can be used in Range_lookup

45
How to use VLOOKUP

Select a cell

Type =VLOOKUP

Double-click the VLOOKUP command

Select the cell where the search

The value will be entered

Type (,)

46
How to use VLOOKUP

Mark table range

Type (,)

Type the number of the column, counted from the left (2)

Type True (1) or False (0) (1)

Hit enter

Enter a value in the cell selected for the Lookup_value

47

You might also like