CSIT Module II Notes
CSIT Module II Notes
Analytics on Spreadsheets
❖ Excel Formulae
• Excel formulae are mathematical expressions that you can use to perform
calculations, manipulate data, and automate tasks in Microsoft Excel. Excel formulae
are built using a combination of operators, cell references, values, and functions.
• Operators include mathematical symbols such as +, -, *, /, and ^ (exponentiation).
Cell references are used to refer to a specific cell or range of cells in the spreadsheet,
and values can be numeric, text, or logical.
• Functions are pre-built formulas that you can use to perform specific calculations or
manipulate data in Excel. Functions can be used to perform simple operations such
as adding and subtracting, or more complex operations such as statistical analysis
and data validation.
• Excel provides a wide range of built-in functions, organized into categories such as
Math and Trig, Statistical, Text, Date and Time, and Logical. Some examples of
commonly used Excel functions include SUM, AVERAGE, COUNT, MAX, MIN, IF, and
VLOOKUP.
• Excel formulae can be entered directly into the formula bar at the top of the
spreadsheet or into a cell by starting the formula with an equals sign (=). As you type
a formula, Excel will provide suggestions and auto-complete options to help you
complete the formula more quickly and accurately.
• By using Excel formulae, you can automate repetitive tasks, perform complex
calculations, and analyze data with ease.
Advanced Excel functions are more complex and powerful built-in functions that can be
used to perform advanced calculations, data analysis, and automation tasks in Microsoft
Excel. Here are some examples of advanced Excel functions:
I. VLOOKUP: This function searches for a value in the first column of a table and
returns a corresponding value from a specified column of the same row.
II. IFERROR: This function allows you to specify a value or action to be taken if an error
occurs in a formula.
III. INDEX-MATCH: This combination of functions is an alternative to VLOOKUP and can
be used to look up a value in a table and return a corresponding value from another
column in the same row.
IV. SUMIFS/COUNTIFS: These functions allow you to sum or count values in a range of
cells that meet multiple criteria.
V. CONCATENATE: This function combines two or more text strings into one string.
VI. AVERAGEIFS: This function allows you to calculate the average of a range of values
that meet multiple criteria.
VII. CHOOSE: This function allows you to select a value from a list of options based on a
specified index number.
VIII. INDEX: This function returns a value from a specified row and column in a table.
IX. TEXT: This function converts a value to text format with a specified format.
X. DATE: This function creates a date from a year, month, and day.
By learning and using advanced Excel functions, you can perform complex calculations,
automate tasks, and analyze data more efficiently and effectively.
➢ SUM FUNCTION
The SUM function in Excel is a basic mathematical function that allows you to add a series of
numbers together. The syntax for the SUM function is:
where number1, number2, number3, etc. are the numbers or ranges of cells that you want
to add together.
The SUM function is a simple but powerful tool that can be used in a wide range of
applications, from basic calculations to complex financial models. It can be combined with
other functions and formulas to perform more advanced calculations and automate tasks in
Excel.
Example: -
To add a range of cells, such as A1:A10, you can use the formula: =SUM(A1:A10), which will
return the sum of all the numbers in cells A1 through A10.
➢ SUMIF FUNCTION
The SUMIF function in Excel is a conditional summing function that allows you to add up
values in a range of cells based on one or more conditions. The syntax for the SUMIF
function is:
where range is the range of cells that you want to evaluate, criteria is the condition that you
want to apply, and sum_range (optional) is the range of cells that you want to add up.
The SUMIF function is a useful tool for performing conditional summing in Excel. It allows
you to add up values in a range of cells based on one or more conditions, making it a
powerful function for data analysis and reporting.
Example: -
• To add up all the values in a range of cells that meet a certain condition, such as
values greater than 50, you can use the formula: =SUMIF(A1:A10, ">50")
• You can also use the SUMIF function to add up values in a range of cells that meet
multiple conditions. For example, to add up the values in a range of cells that meet
both a text and numeric condition, such as all the values in column A where the
corresponding value in column B is "Apples" and greater than 50, you can use the
formula: =SUMIF(A1:A10, "Apples", B1:B10, ">50")
➢ ROUND FUNCTION
The ROUND function in Excel is a mathematical function that allows you to round a number
to a specified number of decimal places. The syntax for the ROUND function is:
=ROUND(number, num_digits)
where number is the value that you want to round, and num_digits is the number of digits
that you want to round to. If num_digits is positive, the number is rounded to the specified
number of decimal places. If num_digits is negative, the number is rounded to the left of the
decimal point.
The ROUND function is a useful tool for formatting numbers in Excel and can be used in a
variety of applications, from simple calculations to more complex financial models. It is
commonly used in accounting and financial analysis to format numbers in reports and other
documents.
• To round a number to two decimal places, such as 3.14159265, you can use the
formula: =ROUND(3.14159265, 2), which will return the result of 3.14.
• If you want to round a number to the nearest whole number, you can use the
formula: =ROUND(3.7), which will return the result of 4.
• You can also use the ROUND function in combination with other functions to
perform more complex calculations. For example, to round the average of a range of
cells to two decimal places, you can use the formula: =ROUND(AVERAGE(A1:A10), 2).
➢ VLOOKUP FUNCTION
The VLOOKUP function in Excel is a lookup function that allows you to search for a specific
value in a table or range of cells and return a corresponding value from another column in
the same row. The syntax for the VLOOKUP function is:
where lookup_value is the value that you want to find, table_array is the range of cells that
contains the lookup value and the corresponding values you want to return, col_index_num
is the column number in the table_array that contains the value you want to return, and
range_lookup (optional) is a logical value that determines whether to find an exact or
approximate match.
The VLOOKUP function is a powerful tool for searching and retrieving data in Excel. It is
commonly used in a variety of applications, from simple data lookup to more complex data
analysis and reporting
Example: -
To find a specific value in a table and return a corresponding value from another column,
such as finding the price of a specific product based on its code in a product list, you can use
the formula: =VLOOKUP(A1, B1:C10, 2, FALSE), where A1 is the lookup value, B1:C10 is the
range of cells that contains the lookup value and the corresponding values, 2 is the column
number that contains the price you want to return, and FALSE ensures an exact match is
found.
➢ HLOOKUP FUNCTION
The HLOOKUP function in Excel is similar to the VLOOKUP function, but it searches for a
value in the first row of a table and returns a corresponding value from another row in the
same column. The syntax for the HLOOKUP function is:
where lookup_value is the value that you want to find, table_array is the range of cells that
contains the lookup value and the corresponding values you want to return,
row_index_num is the row number in the table_array that contains the value you want to
return, and range_lookup (optional) is a logical value that determines whether to find an
exact or approximate match.
The HLOOKUP function is a powerful tool for searching and retrieving data in Excel. It is
commonly used in a variety of applications, from simple data lookup to more complex data
analysis and reporting
Example: -
To find a specific value in the first row of a table and return a corresponding value from
another row, such as finding the price of a specific product based on its code in a product
list, you can use the formula: =HLOOKUP(A1, B1:E10, 3, FALSE), where A1 is the lookup
value, B1:E10 is the range of cells that contains the lookup value and the corresponding
values, 3 is the row number that contains the price you want to return, and FALSE ensures
an exact match is found.
➢ INDEX FUNCTION
The INDEX function in Excel is a powerful lookup function that returns the value at a
specified position within a range of cells. The syntax for the INDEX function is as
follows:
Here, array refers to the range of cells that you want to search, row_num is the row
number within the range where the value is located, and [column_num] (optional) is
the column number within the range where the value is located.
If column_num is omitted, the INDEX function returns the entire row of data. If
row_num is omitted, the INDEX function returns the entire column of data.
Examples: -
• To extract a single value from a range of cells, use the formula
=INDEX(A1:A10,5). This will return the value in the 5th row of column A.
• To extract a value from a table based on two criteria, use the formula
=INDEX(A1:E10,MATCH("apple",A1:A10,0),MATCH("price",A1:E1,0)). This will
return the value in the row that matches "apple" in column A and "price" in
row 1.
➢ Match function
The MATCH function in Excel is a powerful lookup function that returns the position of a
specified value within a range of cells. The syntax for the MATCH function is as follows:
Here, lookup_value refers to the value you want to find, lookup_array is the range of cells
that you want to search, and match_type (optional) specifies the type of match you want to
perform.
If match_type is 1 or omitted, the MATCH function returns the position of the first value
that is greater than or equal to the lookup_value. If match_type is 0, the MATCH function
returns the position of the exact match. If match_type is -1, the MATCH function returns the
position of the first value that is less than or equal to the lookup_value
The MATCH function is a powerful tool in Excel that is commonly used in combination with
other functions like INDEX and IFERROR to perform more complex data lookups and
calculations.
EXAMPLE: -
I. To find the position of a specific value within a range of cells, use the formula
=MATCH("apple",A1:A10,0). This will return the position of "apple" in column A.
II. To find the position of the last value in a range of cells, use the formula
=MATCH(2,1/(A1:A10<>""),1). This will return the position of the last value in column
A.
III. To find the position of the first value that is greater than or equal to a specified
value, use the formula =MATCH(10,A1:A10,1). This will return the position of the first
value that is greater than or equal to 10 in column A.
IV. To find the position of the first value that is less than or equal to a specified value,
use the formula =MATCH(10,A1:A10,-1). This will return the position of the first
value that is less than or equal to 10 in column A.
➢ INDEX MATCH
The INDEX MATCH function in Excel is a powerful combination of two lookup functions that
allows you to search for a specific value within a range of cells and return the value at a
specified position within that range. The INDEX MATCH function is often used as an
alternative to the VLOOKUP function, as it is more flexible and can handle more complex
data structures.
The key advantage of using the INDEX MATCH function over the VLOOKUP function is that
the former is more flexible in handling changes to the data structure. For example, if a new
column is added to a dataset, the VLOOKUP function would require the formula to be
updated to include the new column, whereas the INDEX MATCH function would
automatically adjust to include the new column.
Another advantage of the INDEX MATCH function is that it allows you to look up values in
any column, not just the first column, as in the case of the VLOOKUP function. This makes it
particularly useful for working with large datasets where the information you want to
retrieve may be located in different columns.
The INDEX MATCH function is a powerful tool in Excel that can handle complex data
structures and allow you to retrieve information quickly and easily.
Some examples of how to use the INDEX MATCH function in Excel are as follows:
• To retrieve a value from a table based on a single criteria, use the formula
=INDEX(return_range, MATCH(lookup_value, lookup_range, 0)). For example, to
retrieve the price of an apple, use the formula =INDEX(C1:C10, MATCH("apple",
A1:A10, 0)).
• To retrieve a value from a table based on multiple criteria, use the formula
=INDEX(return_range, MATCH(1,
(lookup_range1=lookup_value1)(lookup_range2=lookup_value2), 0)). For example,
to retrieve the price of a red apple, use the formula =INDEX(C1:C10, MATCH(1,
(A1:A10="apple")(B1:B10="red"), 0)).