Excel - Part III
Excel - Part III
1. Today()
The Today Function Returns the Current Date
• Number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255
numbers for which you want to find the maximum value.
Page 1 of 52
• Number1, number2, ... Number1 is optional, subsequent numbers are optional. 1 to 255
numbers for which you want to find the minimum value.
1. TRUNC(number, [num_digits])
2. ROUND(number, num_digits)
Page 2 of 52
3. COUNT (value1, [value2] ...)
The COUNT function counts the number of cells that contain numbers
• Value1 Required. The first item, cell reference, or range within which you want to count
numbers.
• Value2 Optional. Up to 255 additional items, cell references, or ranges within which you want to
count numbers.
Note The arguments can contain or refer to a variety of different types of data, but only numbers are
counted.
Example:
Page 3 of 52
7. COUNTA (value1, [value2] ...)
The COUNTA function counts the number of cells that are not empty in a range.
The COUNTA function syntax has the following arguments:
• value1 Required. The first argument representing the values that you want to count.
• value2, ... Optional. Additional arguments representing the values that you want to count, up to a
maximum of 255 arguments.
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.
Custom Sorts
To sort on the basis of more than one column:
Page 4 of 52
Filtering
Filtering allows you to display only data that meets certain criteria. To filter:
▪ Click the column or columns that contain the data you wish to filter
▪ On the Home tab, click on Sort & Filter
▪ Click Filter button
▪ Click the Arrow at the bottom of the first cell
▪ Click the Text Filter
▪ Click the Words you wish to Filter
Exercise:
Full Name Dressing Date of Sale Area Shop Amount
type
Roger Shirt 21/09/2013 Maten Big Star 45
Simon Jeans 05/06/2014 Beirut DT 60
Kate Skirt 08/02/2014 Keserwan Zara 150
Tony Tie 09/06/2015 Maten Boss 255
Joy Shirt 15/10/2015 Maten ABC 85
kate Shirt 25/08/2015 Beirut Mango 250
Simon Jeans 31/07/2014 Ashrafieh ABC 156
Kate Tie 29/04/2015 Beirut DT 65
Joy Jeans 03/03/2015 Ashrafieh ABC 125
Joy Skirt 19/06/2015 Keserwan Zara 45
Roger Tie 01/02/2015 Maten ABC 145
Page 5 of 52
Questions
1- Sort the table by Full name in ascending order and Area in descending
2- Filter all Area that the amount between 150 and 255.
3- Filter all area who works in Beirut.
4- Filter the table below using "Advanced Filter" based on the following criteria:
Amount> = 50 or Full Name= Joy
Amount> 65 and dressing type = Shirt
3. In the Insert Slicers dialog box, select the check boxes for the fields you want to display,
then select OK.
4. A slicer will be created for every field that you selected. Clicking any of the slicer buttons
will automatically apply that filter to the linked table.
Notes:
• To select more than one item, hold Ctrl, and then select the items that you want to
show.
• To clear a slicer's filters, select Clear Filter in the slicer.
Page 6 of 52
If users ignore this message and type invalid data in the cell, such as a two-digit or five-digit number, you
can show them an actual error message.
In a slightly more advanced scenario, you might use data validation to calculate the maximum allowed
value in a cell based on a value elsewhere in the workbook. In the following example, the user has typed
$4,000 in cell E7, which exceeds the maximum limit specified for commissions and bonuses.
If the payroll budget were to increase or decrease, the allowed maximum in E7 would automatically
increase or decrease with it.
Data validation options are located in the Data Tools group.
Page 7 of 52
When is data validation useful?
Data validation is invaluable when you want to share a workbook with others in your organization, and you
want the data entered in the workbook to be accurate and consistent.
Among other things, you can use data validation to do the following:
• Restrict data to predefined items in a list For example, you can limit types of departments to
Sales, Finance, R&D, and IT. Similarly, you can create a list of values from a range of cells
elsewhere in the worksheet.
• Restrict numbers outside a specified range For example, you can specify a minimum limit of
deductions to two times the number of children in a particular cell.
• Restrict dates outside a certain time frame For example, you can specify a time frame between
today's date and 3 days from today's date.
• Restrict times outside a certain time frame For example, you can specify a time frame for
serving breakfast between the time when the restaurant opens and 5 hours after the restaurant
opens.
• Limit the number of text characters For example, you can limit the allowed text in a cell to 10
or fewer characters. Similarly, you can set the specific length for a full name field (C1) to be the
current length of a first name field (A1) and a last name field (B1), plus 10 characters.
• Validate data based on formulas or values in other cells For example, you can use data
validation to set a maximum limit for commissions and bonuses of $3,600, based on the overall
projected payroll value. If users enter more than $3,600 in the cell, they see a validation message.
Input messages are generally used to offer users guidance about the type of data that you want entered in
the cell.
You can also choose to show an error alert that appears only after users enter invalid data.
Page 8 of 52
You can choose from three types of error alerts:
Icon Type Use to
Prevent users from entering invalid data in a cell. A Stop alert message has two
Stop
options: Retry or Cancel.
Warn users that the data they entered is invalid, without preventing them from entering
Warning it. When a Warning alert message appears, users can click Yes to accept the invalid
entry, No to edit the invalid entry, or Cancel to remove the invalid entry.
Inform users that the data they entered is invalid, without preventing them from
Information entering it. This type of error alert is the most flexible. When an Information alert
message appears, users can click OK to accept the invalid value or Cancel to reject it.
You can customize the text that users see in an error alert message. If you choose not to do so, users see a
default message.
The main benefit of connecting to external data is that you can periodically analyze this data in Microsoft
Office Excel without repeatedly copying the data, which is an operation that can be time-consuming and
error-prone. After connecting to external data, you can also automatically refresh (or update) your Excel
workbooks from the original data source whenever the data source is updated with new information.
Page 9 of 52
Important Connections to external data may be disabled on your computer. To connect to data when you
open a workbook, you must enable data connections by using the Trust Center bar, or by putting the
workbook in a trusted location.
1. On the Data tab, in the Get External Data group, click Existing Connections.
2. In the Existing Connections dialog box, in the Show drop-down list, do one of the following:
o To display all connections, click All Connections. This is selected by default.
o To display only the recently used list of connections, click Connections in this
Workbook.
This list is created from connections that you have already defined, that you have created
by using the Select Data Source dialog box of the Data Connection Wizard, or that you
have previously selected as a connection from this dialog box.
o To display only the connections that are available on your computer, click Connection
files on this computer.
This list is created from the My Data Sources folder that is usually stored in the My
Documents folder.
o To display only the connections that are available from a connection file that is accessible
from the network, click Connection files on the Network.
3. Tip If you do not see the connection that you want, you can create a connection. Click Browse
for More, and then in the Select Data Source dialog box, click New Source to start the Data
Connection Wizard so that you can select the data source that you want to connect to.
4. Note If you choose a connection from the Connection files on the network or Connection files
on this computer categories, the connection file is copied into the workbook as a new workbook
connection, and then it is used as the new connection information.
5. Select the connection that you want, and then click Open.
6. In the Import Data dialog box, under Select how you want to view this data in your workbook
do one of the following:
Important The Select how you want to view this data in your workbook section and its
options, as shown in the following list, are not available for text, Web Query, and XML data
connections. If you are connecting to such data, continue to step 5.
Page 10 of 52
o To create a PivotTable report for summarizing large amounts of data by aggregating and
subtotaling the data, click PivotTable Report.
o To create a PivotTable report, and PivotChart report for visually summarizing data, click
PivotChart and PivotTable Report.
o To store the selected connection in the workbook for later use, click Only Create
Connection.
Use the Only Create Connection option to store the selected connection in the workbook
for later use. For example, if you are connecting to an Online Analytical Processing
(OLAP) cube data source and you intend to convert PivotTable cells to worksheet
formulas by using the Convert to Formulas command (On the Options tab, in the Tools
group, click OLAP tools), you can use this option because you don't need to save the
PivotTable report.
7. Under Where do you want to put the data?, do one of the following:
o To place the PivotTable or PivotChart report in an existing worksheet, select Existing
worksheet, and then type the first cell in the range of cells where you want to locate the
PivotTable report.
Page 11 of 52
Page 12 of 52
Workshop III
Ex1:
Hours January February March
1---10 521,456 565,412 501,450
11---20 487,152 512,345 658,742
>21 485,478 496,542 581,245
Total 1,494,086 1,574,299 1,741,437
Result
2000000
1800000
1600000
1400000
1200000
1000000
800000
600000
400000
200000
0
1 ---10 11---20 > 21 Total
Ex 2:
Reference Unit discount Net Price Quantity Total
Price 3%
Windows 8.1 standard
edition 239 21
Windows 10 399 14
Office 2013 589 5
Autocad 54.9 24
Antivirus Norton 2015 119.9 12
Power DVD 78.5 31
Works Suite 2013 199 10
Nav2016 74.5 13
Page 13 of 52
Correction:
Reference Unit discount Net Price Quantity Total
Price 3%
€
€ 239.00 € 231.83 21 € 4,868.43
Windows 8.1 standard edition 7.17
€
€ 399.00 € 387.03 14 € 5,418.42
Windows 10 11.97
€
€ 589.00 € 571.33 5 € 2,856.65
Office 2013 17.67
€
€ 54.90 € 53.25 24 € 1,278.07
Autocad 1.65
€
€ 119.90 € 116.30 12 € 1,395.64
Antivirus Norton 2015 3.60
€
€ 78.50 € 76.15 31 € 2,360.50
Power DVD 2.36
€
€ 199.00 € 193.03 10 € 1,930.30
Works Suite 2013 5.97
€
€ 74.50 € 72.27 13 € 939.45
Nav2016 2.24
Total: € 21,047.45
Ex 3:
View in column C the rate of VAT corresponding to the code entered in column B
Correction:
CODE
Items TVA TAUX TVA
Screen 2 5.50%
Desktop 1 2.10%
Printer 3 19.60%
Camera 1 2.10%
Keyboard 1 2.10%
Scanner 3 19.60%
Page 14 of 52
Ex 4
Need a graphical representation of your sales for 2002 till 2005.
She is seeking the following charts:
A graph of the total sales over this period
A graph representing the evolution of sales in the North East.
A graph showing the distribution of sales in 2002.
A graph showing the distribution of sales in 2005.
You will find below the data table from which you must build all required graphs.
Sales breakdown
23,000
10,000
22,500
22,000 Nord Est
5,000
21,500
- 21,000
2002 2003 2004 2005 20,500
20,000
Nord Est Nord Ouest
2002 2003 2004 2005
Sud Est Sud Ouest
Axis Title
Ile de France
Page 15 of 52
2005
13%
25% Nord Est
Nord Ouest
17%
Sud Est
Sud Ouest
Ex 5:
Page 16 of 52