Excel - Part II
Excel - Part II
Format as table:
Quickly convert a range of cells to a table with its own style.
Conditional Formatting
Conditional Formatting allow you to apply formats to a cell or range of cells, and have that
formatting change depending on the value of the cell or the value of a formula.
For example, you can have a cell appear bold only when the value of the cell is greater than 100.
Page 1 of 8
If the Highlight Cells Rules, Top/Bottom Rules, Data Bars, Color Scales and Icon Sets are not sufficient,
you can create a new rule.
Page 2 of 8
Conditional Formatting Rules Managers:
Page 3 of 8
FUNCTIONS
To calculate a function:
Syntax:
SUM (number1, number2,...)
Example 1: Calculate the sum of the cells B2, B3, B4, and B5:
B6 = SUM(B2:B5) or SUM(B2,B3,B4,B5)
Example 2:
Syntax:
AVERAGE(number1, [number2], ...)
Returns the average (arithmetic mean) of the arguments. For example, if the range B2:B5 contains
numbers, the formula =AVERAGE(B2:B5) returns the average of those numbers.
Page 4 of 8
B6: = AVERAGE(B2:B5)
E6: = AVERAGE(E2,G2,I2)
c. IF Function: IF(Conditions,action1,action2)
Use the IF function, one of the logical functions, to return one value if a condition is true and
another value if it's false.
Syntax:
IF(logical_test, value_if_true, [value_if_false]) : It simply tells Excel that if a condition is true,
perform action A, otherwise, perform action B.
logical_test (required) The conditions you want to test.
The value that you want returned if the result of logical_test is
value_if_true (required)
TRUE.(Action1)
The value that you want returned if the result of logical_test is
value_if_false (optional)
FALSE. (action2)
Condition:
A logical operator is used in Excel to compare two values.
Any expression equal to true or false is built by a logical operator taken from the following list :
> Greater than
>= Greater than or Equal To
< Less than
<= Less than or Equal To
= Equal to
<> Not Equal To
Example: B4 < 40 the cell B4 is true while the value less than 40, else false
ACTION: Any valid expression in excel having the desired value.
Page 5 of 8
a. AND Function (Condition1, condition2, …) and OR Function
(Condition1,condition2, …)
Allows writing the complex conditions
• AND Function
Returns TRUE if all its arguments evaluate to TRUE; returns FALSE if one or more arguments evaluate to
FALSE.
• OR Function
Returns TRUE if only one argument evaluate to TRUE; return FALSE if all its arguments evaluate to
FALSE.
OR(Condition1, condition2, …)
Condition:
A logical operator is used in Excel to compare two values.
Any expression equal to true or false is built by a logical operator taken from the following list:
> Greater than
>= Greater than Or Equal To
< Less than
<= Less than Or Equal To
= Equal to
<> Not Equal To
Page 6 of 8
Workshop II
Ex 1:
1. In the "Discount" column, if the amount of the sales order exceeds 10,000 Euros
display "YES" otherwise display "NO"
2. In column D, calculate the amount of discount, knowing that it is 2%
3. Apply a conditional format to the table above.
Ex 2:
Total Net excluding
Name Client Type Gross Duty Discount
Discount taxes
CHRISJAN wholesaler 14650
VISIRIE Retailer 8703
GUENOLA Particular 14540
CASIQUE Wholesaler 8775
GENODI Particular 7602
AGMIR Wholesaler 11215
FERZIT Retailer 8703
VALEZI Retailer 17525
Correction:
Total Net excluding
Name Client Type Gross Duty Discount
Discount taxes
CHRISJAN Wholesaler 14650 5% 732.50 13,917.50
VISIRIE Retailer 8703 0% - 8,703.00
GUENOLA Particular 14540 3% 436.20 14,103.80
CASIQUE Wholesaler 8775 0% - 8,775.00
GENODI Particular 7602 0% - 7,602.00
AGMIR Wholesaler 11215 5% 560.75 10,654.25
FERZIT Retailer 8703 0% - 8,703.00
VALEZI Retailer 17525 3% 525.75 16,999.25
Page 7 of 8
Ex 3:
• Calculate the average of each student
• Indicate whether the student was Passed or failed in the Status column (with the formula If)
• Calculate the average of the class by subject and the total average
• Add to the student a bonus equal to +1/20 if he passed and has an average less than the class average.
• Apply an automated formatting to the below table
• Apply a conditional formatting to the below table : If the bonus = 1 Highlight the cell in Red
Correction:
Page 8 of 8