ICT Week4-2
ICT Week4-2
Program-1
INSTRUCTOR DR. GÜLGÜN AFACAN ADANIR
FORMULAS AND
FUNCTIONS
Using Formulas and Functions
To use formulas and functions, you must first select the
cell you want to enter a formula. Then you can click on the
Add Function icon in the Formula Bar or use the Insert
Function button in the Function Library in the Formulas tab.
When the Insert Function button is used, you can enter a
question that explains the operation you want to do in the
Search Function box from the Insert Function window (for
example, it returns the SUM function) or you can browse
the categories in the Select category box or select the
desired action from the Select Function section.
When the OK button is clicked, the variables are entered
from the Function Arguments window that opens, and the
operation is completed by clicking the OK button.
Using logical functions
The functions to test whether conditions are true or false and to make logical comparisons
between expressions are used in many calculations.
To create conditional formulas; The AND, OR, NOT, and IF functions can be used.
AND Function
AND Function: Returns TRUE if all its arguments are TRUE. Returns TRUE if all of its arguments
evaluate to TRUE; Returns FALSE if one or more of its arguments evaluate to FALSE.
A common use of the AND function is to extend the use of other functions that perform logical
tests.
For example, the IF function performs a logical test and returns one value if the test evaluates
to TRUE and another value if the test evaluates to FALSE.
If the AND function is used as the logical_test argument of the IF function, many different
conditions can be tested instead of a single condition.
AND Function
Syntax: AND (logical1, [logical2], ...). The AND function syntax has the following arguments:
Logical1: Its use is required. The first condition to be tested and that can be considered as TRUE
or FALSE.
Logical2, ...: Its usage is optional. Additional conditions are given that wish to be tested and
that can be considered to be TRUE or FALSE. There can be up to 255 conditions.
OR Function
OR function: Returns TRUE if one of the arguments is TRUE; returns FALSE even if all arguments
are FALSE.
Syntax: OR (logical1, [logical2], ...).
The OR function syntax has the following arguments: Logical1, logical2, ...:
Logical1 is required, the use of the following values is optional. Conditions between 1 and 255
that you want to test for are TRUE or FALSE.
NOT Function
NOT function: Inverts the logic of its argument. The NOT function is used when you want to
check whether a value is equal to a certain value.
Syntax: NOT (logical). The NOT function syntax has the following arguments:
Logical: Its use is required. It is the value that can be evaluated as TRUE or FALSE.
IF Function
IF function: Allows logical comparisons to be made between a value and an expected value.
In its simplest form, IF; It can be defined as IF (If something is true, then do something,
otherwise do something else).
Thus, the IF function can have two results. The first result is that the comparison is True, the
second is that your comparison is False.
In other words; Returns one value if the specified condition evaluates to TRUE, and another
value if the same condition evaluates to FALSE.
IF Function
Syntax: IF (logical_test, [value_if_true], [value_if_allow]). This function's syntax has the
following arguments:
Logical_test: Its use is required. It can be any value or expression that can be evaluated as TRUE
or FALSE. This argument can use any benchmark operator.
Value_if_true: Its usage is optional. The desired value to be returned if the logical_test
argument evaluates to TRUE.
Value_if_wrong: Its usage is optional. The desired value to be returned if the logical_test
argument evaluates to FALSE.
Using mathematical functions
To use the mathematical functions, first of all, the cell you want to write the function must be
selected.
Next, the Math and Trigonometry button in the Function Library must be clicked on the
Formulas tab.
The functions you want to use can be selected here. Some functions under the name of
Mathematics and Trigonometry, their usage purposes and syntax are as follows:
ROUND function
ROUND function: Rounds a number to the specified number of digits.
Syntax: = ROUND (A1, 2)
ROUNDDOWN function
ROUNDDOWN function: Rounds a number by converging it to the smaller number, zero.
Syntax: = ROUNDDOWN (number, number_ digits). This function's syntax has the following
arguments:
Number: Its use is required. Any real number that is desired to be rounded down.
Number_digits: Its use is required. Rounding the number is the desired number of digits.
ROUNDUP function
ROUNDUP function: Rounds a number to the higher number, diverging from zero.
Syntax: = ROUND UP (number, num_ digits)
CEILING function
CEILING function: Rounds a number to the nearest integer or to the nearest multiple.
Syntax: = CEILING (number; meaning) Number: Its use is required. Rounding is the desired
value.
Meaning: Its use is required. It is the desired floor to roll onto itself.
SUMIF function
SUMIF function: Adds cells determined by the given criteria.
Syntax: = SUMIF (B2: B25; "> 5")
Using statistical functions
In order to use the statistical functions, first of all, the cell to which you want to write the
function must be selected.
Then, click the All Functions button in the Function Library in the Formulas tab and select
Statistical from the list that opens.
Click to use the functions listed. Some functions, usage purposes and syntax under the
statistical name are as follows:
COUNTA function
COUNTA function: Counts how many numbers are in the list of arguments.
Syntax: = COUNTA (value1, [value2], ...)
COUNTA function
COUNTA function: Counts how many values are in the list of arguments.
Syntax: = COUNTAIN (value1, [value2], ...)
SPACES function
SPACES function: Calculates the number of blank cells in a range.
Syntax: = BLANK (range)
COUNTIF function
COUNTIF function: Used to find the number of cells that fit a criterion.
Syntax: = COUNTIF (range, criteria)
RANK function
RANK function: Returns the rank of a number in the list of numbers. The position of a number is
its size relative to other values in the list. (To sort the list, the rank of the number is the position
of the number.)
Syntax: = RANK (number, ref, [order]).
The syntax for this function has the following arguments:
Number: Its use is required. The next place is the desired number to find.
Apply: Its use is required. The list of numbers is a sequence or reference. Non-numeric values in
Apply are ignored.
Sequence: Its use is optional. It is a number that indicates how to determine the rank of the
number. If the order is 0 (zero) or is omitted, Microsoft Excel sorts the number as if ref was a list
sorted in descending order. If order is a non-zero value, Microsoft Excel sorts the number as if
ref is a list sorted in ascending order.
Using text functions
In order to use the text functions, it is necessary to select the cell in which you want to write
the function.
Then, the desired function should be selected by clicking the Text button in the Function Library
in the Formulas tab.
Some functions, usage purposes and syntax list under the text name are as follows.
COMBINE function
COMBINE function: Combines multiple text items into one text item.
Syntax: = COMBINE (text1, text2, ...). This function's syntax has the following arguments:
Text1: Its use is required. It is the first item to be combined. This element can be a text value,
number, or cell reference.
Metin2, ...: Its usage is optional. They are additional text items to be combined. Can have a
maximum of 255 items with a total of 8,192 characters
RIGHT function
RIGHT function: Returns the last character or characters in a text string, based on the specified
number of characters. This function's syntax has the following arguments:
Syntax: = RIGHT (text; number_characters)
Text: Its use is required. The text string containing the character you want to extract.
Number_characters: Its use is optional. Determines the number of characters that the RIGHT
function is to extract.
LEFT function
LEFT function: Returns the leftmost characters from a text value, according to the specified
number of characters.
Syntax: = LEFT (text, number_characters)
PARTIAL function
PARTIAL function: Returns a certain number of characters from a text string, starting at the
specified location, according to the specified number of characters.
Syntax: = PARTS (text, start_num, num_characters)
Text: Its use is required. The text string containing the character you want to extract.
Start_num: Required to use. It is the location of the first character you want to find in the text.
The starting_number of the first character in the text is 1, and so on.
Number_characters: Required to use. It specifies the number of characters to be given from the
text.
Using search functions
VLOOKUP and HLOOKUP are functions that are typically used to search for a particular value
from large data.
The VLOOKUP function searches from top to bottom, while the HLOOKUP function searches
from left to right.
VLOOKUP function
VLOOKUP function: Searches the specified value vertically (from top to bottom) within the data
collection that you want to search.
A single value can be searched or multiple data searches can be made.
In the VLOOKUP formula, first the data to be searched should be specified, and then where this
data will be searched. If the searched value is found, the number of the column should be
written.
Finally, it should be specified whether it will be an exact match or an approximate match.
Syntax: = VLOOKUP (lookup_value ,_table_array to search ,_number of_tool_to_column if
found, match type)
VLOOKUP function
1 / TRUE can be used for approximate matching or 0 / FALSE for exact match. Its use is optional.
Example: = VLOOKUP (A1; A3: E128; 5; FALSE)
To create the VLOOKUP syntax, four separate pieces of information are needed: The value that
is desired to search, also called the search value. The range in which the search value is
contained. For the VLOOKUP function to work properly, the lookup value must always be in the
first column in the range. For example, if the lookup value is in cell C2, the range should start
with C. The number of the column in the range that contains the return value.
For example, if B2: D11 is specified as the range, B is the first column, C the second column, and
so on. should be evaluated as. Optionally, the value is TRUE to get an approximate match for the
return value, and FALSE to get an exact match. If it doesn't specify anything, the default is always
TRUE or approximate match.
HLOOKUP function
HLOOKUP function: Searches the top row of the table or the top row of the selected rows for
the searched value and returns the cells below the row it finds as a response.
Syntax: = HLOOKUP (lookup_value; table_array; row_index_num; [range_view]). Example: =
HORIZONTAL ("No"; A3: E128; 2; FALSE). The HLOOKUP function syntax has the following
arguments:
Lookup_value: Usage is required. It is the value to be found in the first row of the table. The
lookup_value can be a value, reference, or text string. Table_array: Usage required. It is the table
of information to search for data. A reference to a range or range name is used. Values in the
first row of table_array can be text, numbers, or logical values.
HLOOKUP function
Line_number: Its use is required. It is the number of rows in table_array for which the matching
value should be given. 1 row_index gives the first row value in table_array, 2 row_index gives the
second row value in table_array. If row_num is less than 1, HLOOKUP returns the #VALUE!
returns an error value; If row_index_num is greater than the number of rows in table_array,
HLOOKUP returns the #REF! gives an error value.
Range_bak: Its use is optional. A logical value that allows HLOOKUP to find an exact or
approximate match. If TRUE or not specified, an approximate warning is given; in other words, if
an exact match is not found, the next largest value less than the search_value is returned. If
FALSE, the HLOOKUP function will find an exact match. If the exact match is not found, an error
value N / A is returned.
Creating a two-level nested function
In a formula that uses a function, using a function as one of its arguments is known as import.
For example, the following formula, in which the AVERAGE and SUM functions nested in the
arguments of the IF function, summarize one group of numbers (A2: A4) only if the average of
another group of numbers (B2: B4) is greater than 50. Otherwise it returns 0.
= IF (AVERAGE (A2: A4)> 50; SUM (B2: B5); 0) In this example, the AVERAGE and SUM functions
are built inside the IF function. In a formula, functions can nest at 64 levels at most.
Using 3-D reference in sum, average,
minimum, maximum functions.
A reference to the same cell or range across multiple sheets is called a 3-D reference. 3-D
references are a useful and convenient way to reference multiple worksheets that fit the same
model and cells that contain the same type of data on each worksheet, in situations such as
combining budgets for different departments in the organization.
For example, to sum cells A2 through A5 in worksheets 2 through 6, the formula = SUM
(Sheet2: Sheet6! A2: A5) is used. For this example, average, minimum, and maximum functions
can be used, apart from taking total, if desired. If sheets are inserted or copied between the 3-D
referenced endpoints (Sheet2 through Sheet6 in the example), Microsoft Excel adds all values in
cells A2 through A5 in the inserted sheets to the calculations. If the worksheets between these
endpoints are deleted, Excel removes their values from the calculation. If these worksheets are
moved to a position outside of the sheet range, Excel removes their values from the calculation.
Using mixed references in formulas
Cell reference is relative by default. For example, referring from cell C2 to cell A2, actually two
columns referenced the cell on the left (C minus A) and in the same row (2). When a formula
containing a relative cell reference is copied from one cell to another, the formula changes.
For example, if the formula = A2 + B2 is copied from cell C2 to cell D2, the formula in D2 will be
adjusted one column to the right, and = B2 + C2. If the original cell reference in this example is to
be preserved when copied, the cell reference must be made absolute by placing a dollar sign ($)
with (2) rows and columns (A and B). Then, the formula = $ A $ 2 + $ B $ 2 remains exactly the
same when copied from C2 to D2.