Course #1
Course #1
Course N°1 :
EXCEL Basics
I- INTRODUCTION
Excel is software from the Microsoft office suite that allows you to perform basic
and very advanced calculations. Integrated into many companies, the Excel
spreadsheet offers you the possibility of creating tables, automatic calculations,
graphs, databases (BDD), etc.
1-Presentation of Excel :
Page : 1 / 7
Informatique 4 (second year ESMT)
1
2
4 5
1 TITLE BAR
2 MENU BAR
3 TOOL BAR
4 NAME ZONE
5 FORMULA BAR
A spreadsheet includes:
Page : 2 / 7
Informatique 4 (second year ESMT)
• 16 384 columns, whose header boxes are named A to Z, then AA to AZ, then BA
to BZ, CA to CZ, and so on until XFD.
• 1 048 576 lines, whose header boxes are numbered from 1 to 1 048 576.
• The intersection between a column and a row forms a cell whose name is the
letter of the column followed by the number of the row exp: B2
• A rectangle constituting a set of cells is called a cell range (or matrix), the latter
is designated by the reference of the first cell, a colon then the reference of the last
cell exp: “B2:E8”:
The active area is the smallest range of cells, starting with cell A1, and containing
all the data in the worksheet.
3. Content of a cell
• The content of a cell can be a number, text, date,… or a formula. For the content
to be interpreted as a formula, simply precede it with “=, + or -”. Exp:
TEXT FORMULA
Page : 3 / 7
Informatique 4 (second year ESMT)
- “Number” group : In the “Number” group you can change the format of the
content in a cell: general, text, date, time, currency, etc.
• Choose the horizontal and vertical position of the text in the cell.
• Choose the color of the characters as well as the background of the cell.
• Apply borders to cells. Applying a border to a cell includes the cell in the
active area.
4. Handling worksheets
Page : 4 / 7
Informatique 4 (second year ESMT)
5. Conditional formatting
Conditional Formatting (or CF) is a tool for highlighting data, useful in all areas.
Excel has a number of predefined CF:
Page : 5 / 7
Informatique 4 (second year ESMT)
Applications :
1- Display in red the amounts between 16 000.00 DZD and 19 000.00 DZD.
4-Display the amounts for the month of April in the form of a blue bar
6. Concept of formula
B1 & B2 are references, “^” the exponent operator, 3 & 6 the numbers (constants).
7. Concept of function
The function is a pre-written formula that takes one or more values, performs an
operation, then returns one or more values, exp: SUM (nb1; nb2;…) this function
returns the sum of the values nb1, nb2,…, the latter can be numbers or references to
one or more cells.
Examples: As part of this first course we will only work with: SUM, AVERAGE,
MAX, MIN.
Page : 6 / 7
Informatique 4 (second year ESMT)
8. Concept of graph
Excel graphs allow the graphical representation of data, so the graph will be
automatically updated once the data is modified.
To insert a graph, simply choose a type in the “Graphics” group in the “Insert”
menu, at which point 3 tabs appear in the menu bar titled “Creation”, “Layout” and
“Formatting”. In “Creation” you can modify the type and style of the graph, in
addition you can choose and modify the data used in the graph. The “Layout” tools
allow you to modify the names and layouts of the axes and the labels (legend, axis
titles, graph title, etc.), as well as the graph name.
Example:
This table represents the weekly temperature morning, evening and night. A
graphical representation better shows the temperature variation, for this we have
inserted a 3D line type graph, the days on the horizontal axis, and the temperature
on the vertical axis.
Page : 7 / 7
Informatique4 SECOND YEAR ESMT
So the formula used in cell “D2” is: «B2*C2*(1+$E$2)». Where “B2” and “C2”
successively represent “Price_U” and “Qt” of the second line, while “$E$2” represents
the “VAT” which remains unchanged.
Copying/pasting cell “D2” into “D5” automatically gives the formula: «(B5*C5)*(1+$E$2)».
Page : 1 / 4
Informatique4 SECOND YEAR ESMT
We notice that the line numbers in the relative references “B2” and “C2” are
incremented by “3” while their columns are not changed, and this is because “D5” is
on the same column as “D2” but in 3 lines after the latter.
3. Mixed reference
An A$1 or $A1 style reference tells Excel how to find another cell by combining
absolute and relative column or row references. They are indicated by placing the $
sign in front of the letter corresponding to the column or in front of the line number.
For example in the reference $A1, the column reference ($A) is absolute while the
row reference (1) is relative.
3. Type the name you want to use to refer to your selection and press “Enter”.
Page : 2 / 4
Informatique4 SECOND YEAR ESMT
This error occurs when you specify an intersection of two areas that do not actually
intersect. The intersection operator is a space character between references.
Example =SUM(A1:A5 A6:A8). It will show the error #NULL! because the
intersection between the 2 ranges is the empty set.
Value error:
Page : 3 / 4
Informatique4 SECOND YEAR ESMT
This error occurs when the application does not recognize the text of a formula.
• You used a cell or cell range name that does not exist.
• Text was entered in a formula without being enclosed in quotation marks: “ ”.
• A function has been misspelled :
for example if you write the formula in a cell: =Averg (A1:F6)
Number error
Page : 4 / 4
Informatique4
Second year ESMT
Course N°3
Sorting, filtering and search functions
- Page : 2 / 6
The filter arrow in the table header changes to the following icon : to indicate
that a filter is applied. Click on it to edit or remove the filter.
1. Click the arrow in the table header of the column you want to filter.
2. If the column has numbers, click Number Filters. If the column contains texts,
click on Text Filters.
Search_value: value that will be searched for in the first column of the Data_Range.
Data_range: Search source range.
Column_index: Number of the column which contains the wanted value.
[Near_Value]: A logical value (TRUE or FALSE) that specifies whether you want
VLOOKUP to find an exact match or an approximate match (optional parameter).
Application :
- Page : 3 / 6
In this example the function returns the name of the customer with ID=46, i.e. Mohamedi
- Page : 4 / 6
The formula returns 6, which corresponds to the position of the best month in the
sales column (the number 99000,00 DZD is the sixth in the range B2:B13).
Note: If each reference box contains a single row or column, the row_num or
column_num argument, respectively, is optional. For example, for a single-line ref
argument, use the INDEX(ref;;col_no) function.
• line_n° [Required]: Represents the number of the reference line from which a reference
should be returned.
- Page : 5 / 6
• col_n°: Represents the reference column number from which a reference should be returned.
• zone_n° [Optional]. Selects a reference range from which to return the intersection of line_n°
and col_n°. The first zone selected or entered is numbered 1, the second is numbered 2, and so
on. If field_number is omitted, INDEX uses field 1. The fields listed here must all be on one sheet.
If you specify areas that are not on the same sheet, a #VALUE! Error will appear.
Application :
- Page : 6 / 6
« Course N° 04 »
MATHEMATICAL FUNCTIONS
I- Reminder:
A function is made up of the equal sign (=), its name and the parameters, also called
arguments (they are not obligatory). These parameters can be of different types and the number
of parameters varies depending on the functions.
=FUNCTION_NAME (PARAMETER1; PARAMETER2;...)
II- Mathematical functions:
1. The SUM function
The values entered into this function will be added. It is used in the form: Sum (nbr1;
nbr2;…), the arguments are separated by « ; »
Application :
• Sum (3; 5) 3+5.
• Sum (A2:A4) A2+A3+A4.
• Sum (A2; B3: E5; 15) A2+B3+B4+B5+ C3+C4+C5+ D3+D4+D5+ E3+E4+E5+15.
• Sum (A2: E5 B4: E6; Z5) Sum (B4: E5; Z5) B4+B5+C4+C5+D4+D5+E4+E5+ Z5
2. The PRODUCT function
The PRODUCT function allows you to multiply several numbers or cells together.
Page : 1 / 5
Informatique4 math functions
The QUOTIENT function returns the integer part of a division and is written as follows, and
takes 2 parameters: the divisor and the dividend.
=QUOTIENT(100;30)
Page : 2 / 5
Informatique4 math functions
Examples:
Page : 3 / 5
Informatique4 math functions
TRADUCTION :
ENGLISH FRENCH
SUM SOMME
PRODUCT PRODUIT
QUOTIENT QUOTIENT
INT ENT
ROUND ARRONDI
ROUNDDOWN ARRONDI.INF
ROUNDUP ARRONDI.SUP
EXP EXP
SQRT RACINE
FACT FACT
POWER PUISSANCE
LOG LOG
LN LN
LOG10 LOG10
MOD MOD
EVEN PAIR
SUBTOTAL SOUSTOTAL
Page : 5 / 5
Course N° 5
Logical functions
Definition:
A logical function is a function that has at least one parameter that can be true or
false or that returns a result that can be true or false.
1. The IF Function:
Returns one value if a specified condition is true and another value if the latter is
false. This syntax is:
Example: if we want to write a formula which gives the absolute value of an integer
we write:
IF
Note: to calculate the absolute value you can use the ABS( ) function.
Informatique 4 Page : 1 / 6
• Score < 5 Mention: “Very weak”.
In this example we have three nestings of “SI”. The “value_if_false” argument is replaced
by an “IF” function in three nestings.
Combining the IF( ) function with AND( ) and OR( ) returns a value if a set of conditions is
met, and another value otherwise.
Application :
The AND( ) function returns TRUE if all of these arguments are TRUE.
Informatique 4 Page : 2 / 6
• A student can only move to the next level if he or she has both averages (general and
Main) greater than or equal to “10”.
• It is enough for one of the two numbers (X, Y) to be zero for their product to be zero.
4. ISBLANK
The ISBLANK( ) function returns TRUE if the value argument is empty, FALSE if the value
argument is not empty.
Example:
Informatique 4 Page : 3 / 6
5. ISTNUMBER
The ISNUMBER( ) function returns true if the value argument represents a number.
Example:
6. ISTEXT
Example:
Informatique 4 Page : 4 / 6
7. The COUNTIF function:
This formula allows you to count the number of non-empty cells corresponding to the
desired criterion.
Range: is the range of cells on which we will look for the number of cells corresponding
to the desired criterion.
This function allows you to add several cells according to a determined criterion. Its
syntax is: SUMIF (range; criterion; [sum_range])
Important: “range” and “sum_range” must have the same number of cells.
• [sum_range]: The range of cells where the numbers to be added are located.
Example:
Informatique 4 Page : 5 / 6
• E2 = SUMIF(B2:B7; ">24";C2:C7)
• E4 = SUMIF (B2:B7;"<=24";C2:C7)
NOTE: if the sum is done in a matrix but the verification is done on several matrices we
must use the SUMIFS fct:
SUMIFS(sum_range,criteria_range1,criteria1,criteria_range2,criteria2…)
This function allows you to calculate the average of several cells according to a
determined criterion. Its syntax is: AVERAGEIF(range,criteria, [average_range])
Informatique 4 Page : 6 / 6
Second year
Module : Informatique4
Course N° 6
Text functions
A text function is a function that has an alphanumeric value as a parameter or that
returns an alphanumeric value or both at the same time.
In practice, these text functions are applied to codes (exp: bank code, vehicle number,
bar code of a merchandise, etc.)
Please note: an alphanumeric code does not necessarily contain letters, for example:
0014536
1- The CONCATENATE function
Allows you to assemble several character chains to form only one.
Syntax: =CONCATENATE (text1; text2; ...) but also =Ref_cellule&Ref_cellule& …
The & sign is then called a concatenation operator.
Important: when merging cell contents, you must always think about space. This
must then appear between quotation marks.
Application :
A B
1 Nom Prénom
2 Youcefi Mohammed
… …
The formulas for Concatenate:
Possible formulas To insert a space To insert a comma
= CONCATENATE(A2;B2) = CONCATENATE(A2;" ";B2) = CONCATENATE(A2;" , " ;B2)
= A2&B2 = A2&" "&B2 = A2&" , "&B2
YoucefiMohammed Youcefi Mohammed Youcefi , Mohammed
Allows you to extract one or more characters from the middle of a text.
Syntax: MID (text; start_num; char_nbr)
•text: Represents the text containing the characters to extract.
•start_num: Represents the position in the text of the first character to extract.
•nbr_char: The number of characters to extract.
Example: Consider an array containing several character strings. Each character
string is built on an identical format. The goal is to extract the identifier indicated in
this character string. This information is located at the 31st character and consists of
four digits (Example for line 3: The identifier is 1587)
important: A space is considered a character.
code
Page : 2 / 4
6.The LEN function
Preview :
7. Text function
Converts a numeric value(number, date, time..) to text using a number format.
Syntax: =TEXT(value; text_format)
value: represents a numeric value, a
formula whose result is a numeric value, or
a reference to a cell containing a numeric
value.
text_format: is a numeric format in the
form of a text chain enclosed in quotation
marks.
Example :
8. REPT function
The REPT( ) function is used to repeat text or the contents of a cell a certain number of times.
Syntax: =REPT(text;Nbtimes)
• text: represents the text to repeat.
• Nbtimes: is a positive number indicating the number of repetitions.
So, REPT("A";5) returns the result AAAAA, or if the content of cell C2 is the
character A, REPT(C2;3) returns AAA.
Example
Page : 3 / 4
In this example we have codes in column C that must be completed with zero (0) so
that the complete code is 9 characters long:
TRADUCTION :
ENGLISH FRENCH
CONCATENATE CONCATENER
Left GAUCHE
Right DROITE
Upper MAGISCULE
Lower MINISCULE
PROPER NOMPROPRE
MID STXT
LEN NBCAR
Text TEXTE
REPT REPT
Page : 4 / 4
Course N° 7
Date and time functions
The NOW ( ) function
The NOW function returns the date and time at the time of calculation, and indicated
by the PC's internal clock.
The syntax : =NOW( )
This function has no arguments. The current date and time are automatically
updated with each recalculation. The date and time are displayed in the custom format
DD/MM/YYYY HH:MM if the cell containing the formula is in standard format before
inserting the formula.
Example: the case of the time of an operation in a vending machine or the time of
manufacture of a food product…
The TODAY() function
This function allows you to automatically display the system (computer) date in a
cell. You can also use this function in combination with another calculation formula on
dates.
Here is its syntax: =TODAY( )
Please note: There is nothing to write between parentheses
Example: You have entered a due date in cell A1 (for example 12/04/2024). In B1 you
want to know the number of days remaining between this due date and today's date.
In B1 you write: =A1-TODAY( )
Assuming that today's date is March 14, 2023, the result is: 30 (if the cell format is
Standard)
(Attention: the result here can be negative, for example: if today's date is April 14,
2024, the result will be: -2)
The DAY() function
This function allows you to extract the number of the day of the month from a date
entered in a cell (or in the formula itself). The extracted number can thus be used to
perform calculations or tests as part of a logical function.
Here is its syntax: =DAY( )
Example: You have entered a payment date in cell A1 (for example 12/06/2004). In
B1 you want to know the day on which the invoice must be paid taking into account a
payment deadline of 8 days. In B1 you write: =DAY(A1)+8
- Page : 1 / 4
The result will be: 20
The MONTH() function
This function allows you to extract the month number from a date entered in a cell
(or in the formula itself). The extracted number can thus be used to perform
calculations or tests as part of a logical function.
Here is its syntax: =MONTH( )
Example: You have entered a payment date in cell A1 (for example 12/06/2004). In B1
you want to know the day on which the invoice must be paid taking into account a
payment deadline of 2 months. In B1 you write: =MONTH(A1)+2
The result will be: 8
The YEAR() function
This function allows you to extract the year number from a date entered in a cell (or
in the formula itself). The extracted number can thus be used to perform calculations
or tests as part of a logical function.
Here is its syntax: =YEAR( )
Example: You entered a date in cell A1 (for example 12/06/2004). In B1 you want to
add a year to this date. In B1 you write:
=YEAR(A1)+1
The result will be: 2005
The DATE() function
This function can be combined with the functions above. But it can also be used
alone. This function allows you to calculate one date from another. You can also use
this function in combination with another calculation formula on dates.
Here is its syntax: =DATE(year; month; day)
Example 1: You have entered a payment date in cell A1 (e.g. 12/06/2004). In B1 you
want to know the day on which the invoice must be paid taking into account a
payment deadline of 2 months. In B1 you write:
=DATE(YEAR(A1);MONTH(A1)+2;DAY(A1))
The result will be: 12/07/2004
Note: if the sum of the months exceeds 12, the year will be incremented automatically,
in this example if the period is 7 months the result will be 12/01/2005
Example 2: You need to automatically obtain the date of the last day of the accounting
exercise. You have entered the date of purchase of a product in cell A1 (for example
15/06/2004). In B1 you want to obtain the year-end date (namely December 31 of the
year). In B1 you write:
=DATE(YEAR(A1);12;31). The result is: 31/12/2004
- Page : 2 / 4
Question: write the formula that displays the semester end date for each product.
The DATEDIF function:
This function calculates the difference between two dates in years, months and days.
It has 3 arguments:
Syntax: =DATEDIF(Date1;Date2;code)
This function returns the difference between Date1 and Date2 (note, Date2>=Date1)
according to the Code argument, which can take the following values:
• “y”: difference in years (year)
• “m”: difference in months (month)
• “d”: difference in days (day)
• “ym”: difference in months, once the years are subtracted
• “yd”: difference in days, once years subtracted
• “md”: difference in days, once years and months are subtracted
The DATEDIF( ) function can be used in particular to calculate ages.
For example, if cell A1 contains a date of birth and cell A2 contains today's date:
Example: in A1: 20/04/1963 and in A2: 27/05/2002
Formula Result
Formula Result
=DATEDIF(A1;A2;"y") 39
=DATEDIF(A1;A2;"m") 469
=DATEDIF(A1;A2;"d") 14282
=DATEDIF(A1;A2;"ym") 1
=DATEDIF(A1;A2;"yd") 37
=DATEDIF(A1;A2;"md") 7
- Page : 3 / 4
Example: You have entered a payment date in cell A1 (for example 06/09/2004). In B1
you want to know the corresponding day of the week. In B1 you write:
=WEEKDAY(A1;2)
The result is: 3
The HOUR function
The HOUR function extracts the time (an integer between 0 and 23) from a time
code (a fraction of 24 hours).
The serial_number argument is a time value containing the time you want to find.
The MINUTE function
The MINUTE function extracts minutes (an integer between 0 and 59) from a time
code (a fraction of 24 hours).
The syntax : =MINUTE(serial_number)
The serial_number argument is a time value containing the minutes you want to find.
The SECOND function
The SECOND function extracts seconds (an integer between 0 and 59) from a time
code (a fraction of 24 hours).
The syntax : =SECOND(serial_number)
The serial_number argument is a time value containing the minutes you want to find.
- Page : 4 / 4
Informatique4 Second year ESMT
Simply click with the [Ctrl] key on any tab to form a workgroup between the active
sheet and that of the tab. As soon as this is done, at the top of the sheet, the text “[Group]”
appears to the right of the workbook name.
You add or remove a sheet from the group by [Ctrl]-clicking on its tab.
If you want to integrate a whole series of sheets into a new group at once, activate
the first sheet then [Shift]-click on the name of the last one, then remove it with a [ Ctrl]-
click those that are in excess.
Example :
To reference a cell in another sheet on the same workbook, use the following format:
Sheet_name!Cell_Address. So you must precede the address of the cell in question with the
name of the sheet followed by an exclamation point. If the sheet name contains a space, it
must be surrounded by apostrophes; Example: =’Sheet one’!A9
Example :
In this example cell A1 of sheet2 contains the product of cells A1 and B1 of sheet1.
For the use of ranges of cells with the same references, located on different sheets of the same
workbook; We indicate the name of the sheets, followed by an exclamation point, then the cell
reference.
Example: B10=sum(Sheet1:Sheet3!B2:C8)
B10=the sum of the values of all the cells in the ranges B2:C8 displayed on the 3 sheets.
B/ External dynamic links:
An external reference (or link) is a reference to a cell or range of cells in a worksheet in
another Excel workbook.
There are two ways to view external references to other workbooks, depending on
whether the source workbook is open in Excel or closed.
When the source is opened in Excel, the external reference contains the workbook name in
right brackets ([ ]), followed by the worksheet name, an exclamation point (!), and the cells
the formula depends on. For example, the following formula adds the cells in the range
C10:C25 in the Budget.xlsx workbook.
When the source is not open in Excel, the external reference contains the entire path.
External reference: =SUM(’C:\Reports\[Budget.xlsx]Annual’!C10:C25)
The mailings process allows you to create a set of documents from an Excel sheet,
for example letters sent to a large number of people. The unique information for each
letter or label comes from entries stored in a data source.
Excel sheet : Set of doc :
Model :
To illustrate this function, we will create a standard document with Word and use
an Excel file as a database.
• Step 01: Define the type document (for example: Word file).
• Step 02: Connect the document to a data source (for example: Excel file).
• Step 03: Add placeholders, called merge fields, to the standard document.
Before starting to create the standard document, you must first create a data source
via an Excel file (you can also use an Access database) containing the information
necessary for the mailing.
The commands to initiate a mail merge process are found on the Mailing tab.
After connecting your base document to a data source, you can type the text for your
document and add placeholders indicating where the unique information will appear on
each copy of the document.
Placeholders are called merge fields. The fields displayed in Word correspond to the
column headers of the selected data file.
• In a data file, lines represent records of information. Word generates a copy of the
base document for each record when initiating a mail merge process.
You can preview your merged documents and make changes before starting the
actual merge process using the Preview Results tool.
You can print the merged documents or edit them one by one. You can print or
modify all or part of the documents.
Arguments can either be numbers or names, arrays, or references that contain numbers.
Logical values and text representations of numbers that you type directly into the list of
arguments are counted.
If an array or reference argument contains text, logical values, or empty cells, those values
are ignored; however, cells with the value zero are included.
If you want to include logical or text values in a reference as part of the calculation, use the
AVERAGEA function.
Note : in the AVERAGEA function : Arguments that contain TRUE evaluate as 1; arguments that
contain FALSE evaluate as 0 (zero). Array or reference arguments that contain text evaluate as 0 (zero).
EXAMPLES :
• Average (3; 7) (3+7)/2.
• Average (B3: B8; “12”;FALSE) (B3+B4+B5+B6+B7+B8+12+0)/8.
2. The “MIN” and “MAX” functions:
“Min” Returns the smallest number in the series of arguments, while “Max” returns the largest number.
(They ignore logical values and text)
EXAMPLES :
• Min (23; 13; 4; 8) = 4.
• Max (23; 13; 4; 8) = 23.
3. The COUNTA function:
Counts the number of cells that are not empty and the values included in the argument list.
Application: D2 = COUNTA (B2:B7).
Note2: Empty cells, logical values or text in the array or reference are ignored if you use VAR
Note3: If you want to include logical and text values in a reference as part of the calculation, use the VARA function.
Note4: VARPA ?
2
8. The Standard deviation function: (Ecart-type in french)
Estimates standard deviation based on a sample. The standard deviation is a measure of how widely
values are dispersed from the average value (the mean).
9. RANK
The RANK function allows you to give each value a ranking
(in ascending or descending order) Example :
Syntax: RANK(number ; reference ; order)
number: The element whose rank we want to know.
reference: The list of elements. The rank is calculated based
on this reference.
order: Allows you to determine the order of classification:
• If the order argument has the value 0, the largest element in
the list will have rank 1
• If the order argument has the value 1, the smallest element
in the list will have rank 1
10- LINEST
The LINEST function calculates the statistics for a line in order to calculate a straight line that fits your
data as closely as possible, then returns a matrix that describes this line.
Syntax: LINEST(known_ys ; [known_xs] ; [constant] ; [statistics])
Example:
3
11. Correlation Coefficient (belongs to [0,1])
This function returns the correlation coefficient of two ranges of cells. Use the correlation
coefficient to determine the relationship between two properties. For example, you can examine
the relationship between the average temperature of a home and the use of air conditioning.
Syntax: CORREL (matrix1; matrix2)
matrix1 : Range of cell values.
matrix2 : A second range of cell values. (must have the same size of matrix1)
A correlation coefficient close to 0 indicates low correlation or no correlation, and a coefficient
close to 1 indicates a high correlation between the two properties
Example
4
12- Determination Coefficient (belongs to [0,1])
The coefficient of determination is an index of the quality of the prediction of linear regression. The
closer it is to 1, the better the linear regression fits the data collected.
x_known: An array or range of data points. (must have the same size of y_known)
Example:
TRADUCTION :
N° ENGLISH FRENCH
1 AVERAGE Moyenne
Max Max
2
Min Min
3 COUNTA NBVAL
4 COUNTBLANK NB.VIDE
5 MEDIAN MEDIANE
6 MODE MODE
7 VAR VAR
8 STDEV ECARTYPE
9 RANK RANG
10 LINEST DROITEREG
11 CORREL COEFFICIENT.CORRELATION
12 RSQ COEFFICIENT.DETERMINATION