Introduction to Microsoft Excel
Features ä calculates and recalculates (immediate results) ä graphical data representation (chart) ä carries out “What-if” analysis ä i.e., an evaluation in which certain values are changed in order to reveal the effects of those changes on decision-making
Basic Arithmetic Operators ä +:- addition ä -:- subtraction ä *:- multiplication ä /:- division ä ^:- exponentiation
Terminology ä Worksheet ä consists of columns and rows ä the intersection of columns and rows is called “cell”. ä Columns are denoted by letter, e.g. A, B,..., ä Rows are denoted by number, e.g. 1, 2,...
Terminology ä Active cell ä the cell in which data is entered ä “F2” is the function key to modify the cell’s contents ä Workbook ä the collection of worksheets, the file format of MS Excel, its file extension is “XLS”
Terminology ä Cell reference/Relative address ä naming convention that starts with column, then row ä e.g., A1, B7
Terminology ä Absolute reference/address ä a dollar sign “$” precedes column and row ä e.g. $A$1, $B$7 N.B. absolute address is used when the calculation involved a fixed address/range
Terminology ä Range ä an address specified by the started and ended cells with a colon in between e.g., A1:B7, $A$1:$B$7 ä Formula ä defined by user to perform specific calculation, must be started with an equal sign “=” e.g. =A1+B7
Terminology ä Functions ä a built-in formula that assists calculation, some common functions of Excel are SUM, AVERAGE, COUNT, MIN, and MAX ä Macro ä records frequently used commands/operations, retrieves in future to perform the recorded commands in single run
Functions ä function can be edited directly in the cell or; ä using the Function Wizard
Edit Menu ä contains the “Cut”, “Paste” and “Copy” commands ä Delete... ä deletes the selected columns or rows ä Delete Sheet ä remove the current selected worksheet from workbook
Format Cell ä Number format Decrease Decimal Currency Style Increase Decimal Percentage Style Comma Style
Insert Menu ä Name ä defines a name to a range ä Picture ä inserts picture/clipart into a worksheet
Insert Menu ä Worksheet ä inserts a blank worksheet to a workbook ä Chart ä inserts a chart object into current or a new worksheet
Inserting Chart ä selects the data range where the chart is created from (CTRL+Mouse) ä selects the Chart Wizard ä selects the type of charts ä enters the details of chart such as titles, scales, etc.
Modifying Chart ä double click on the Chart object to modify the items in the Chart
Modifying Axis Scale ä double click on the axis ä edits the “Scale”
Modifying Legend ä right-click on the graph ä chooses “Format Data Series” ä edits the “Name and Values” box
Creating Combination Graph ä the data have to be specified twice at the first step in creating the graph
Protecting A Worksheet ä worksheet can be locked to prevent from editing by others Tools Menu Protection Protect Sheet
Split Window Setup Window Menu Split ä moves the split lines Clear Window Menu Remove Split
Freeze Panes Setup ä positions the active cell Window Menu Freeze Panes Clear Window Menu Unfreeze Panes
Data Sorting ä selects the range to be sorted Data Menu Sort ä specifies the sorted key and ordered method
Data Filtering Setup ä selects the header range Data Menu Filter AutoFilter ä chooses the drop down box and specifies the criteria
Data Filtering Clear Data Menu Filter AutoFilter
Working On Multiple Worksheets ä cell/range can be linked to other worksheets e.g., cell B1 in Sheet2 contains the formula: =Sheet1!A10
Logical Functions ä IF() ä NOT() ä AND() ä OR()
Function - IF() ä returns one value if logical test is true, another value if logical test is false Syntax: IF(logical_test, value_if_true, value_if_false) Example IF(9 < 8,C1+1,D1*2)
If 9 < 8 then returns C1+1 otherwise returns D1*2 IF(9<8, C1+1, D1*2) Example -IF() Logical test otherwisethen
Function - AND() Syntax: AND(logical_1, logical_2,...) ExampleIF(AND(A1>0,B1>0),C1,D1) AB AND(A, B) TRUETRUETRUE TRUEFALSEFALSE FALSETRUEFALSE FALSEFALSEFALSE ä returns true if all the logical values are true.
Function - OR() Syntax: OR(logical_1, logical_2,...) ExampleIF(OR(A1>0,B1>0),C1,D1) AB OR(A, B) TRUETRUETRUE TRUEFALSETRUE FALSETRUETRUE FALSEFALSEFALSE ä returns true if one of the logical values is true.
Function - NOT() ä negates the logical value Syntax:NOT(logical_value) ANOT(A) TRUEFALSE FALSETRUE
Statistical Functions COUNT() COUNTIF() COUNTA() COUNTBLANK() AVERAGE() SUM() SUMIF() SUMPRODUCT() SUMSQ() LARGE() MIN()SMALL() MAX()RANK()
Function - COUNT() ä counts the number of numeric entries in the given argument Syntax: COUNT(value1, value2,...) ExampleCOUNT(A1:B7)
Function - COUNTIF() ä counts the number of entries in the specified range that satisfies the given criteria, note that the criteria has to be “quoted” Syntax: COUNTIF(Range, Criteria) Example COUNTIF(A1:B7, “>=40”)
Function - COUNTA() ä counts the number of non-empty entries in the specified range Syntax:COUNTA(Range)ExampleCOUNTA(B2:E6)
Function - COUNTBLANK() ä counts the number of blank entries in the specified range Syntax:COUNTBLANK(Range)ExampleCOUNTBLANK(B2:E6)
Function - AVERAGE() ä calculates the average of a given arguments Syntax: AVERAGE(number1, number2,...) ExampleAVERAGE(A1:B7)
Function - MIN() ä finds the minimum value of a given arguments Syntax: MIN(number1, number2,...) ExampleMIN(A1:B7)
Functions - MAX() ä finds the maximum value of a given arguments Syntax: MAX(number1, number2,...) ExampleMAX(A1:B7)
Function - SUM() ä finds the sum of a given arguments Syntax: SUM(number1, number2,...) ExampleSUM(A1:B7)
Function - SUMIF() ä computes the sum of “range2” if “range1” satisfies the criteria Syntax: SUMIF(range1, criteria, range2) Example SUMIF(A2:A11, “>7”, B2:B11)
Function - SUMPRODUCT() ä multiplies corresponding components in the given array, and returns the sum of those products. Syntax: SUMPRODUCT(range1, range2) Example SUMPRODUCT(A2:A11, B2:B11)
Function - SUMSQ() ä returns the sum of the squares of the arguments Syntax: SUMSQ(range1, range2) Example SUMSQ(A2:A11, B2:B11)
Function - LARGE() ä returns the n-th largest value in the data set Syntax: LARGE(range, n) Example LARGE(A2:A11, 4)
Function - SMALL() ä returns the n-th smallest value in the data set Syntax: SMALL(range, n) Example SMALL(A2:A11, 4)
Function - RANK() ä returns the rank of a number in a list of numbers Syntax: RANK(num, range, order) Example RANK(A2, A2:A11) 0 - descending non zero - ascending
Mathematical Functions ABS() INT() MOD() SQRT() ROUND() RAND() TRUNC() QUOTIENT()
Function - ABS() ä returns the absolute value of a given number Syntax:ABS(number)Example ABS(-2) = 2 ABS(-12.5) = 12.5
Function - INT() ä returns the integer/integral part of a given number Syntax:INT(number)Example INT(2.58) = 2 INT(-2.5) = -3 (take the smallest integer)
Function - MOD() returns a remainder after a / b where b Syntax: MOD(number, divisor) Example MOD(5, 3) = 2 MOD(10,5) = 0
Function - SQRT() ä returns the square root of a given number Syntax:SQRT(number)Example SQRT(16) = 4
Function - ROUND() ä rounds a number to the specified nearest decimal place Syntax: ROUND(number, decimal) Example ROUND(10.475, 2) = ROUND(10.824, 0) = 11
Function - ROUND() Example ROUND(123.47, -1) = 120 ROUND(125.47, -2) = 100
Function - TRUNC() ä truncates a number to an integer by removing the fractional part of the number Syntax:TRUNC(number)Example TRUNC(8.9) = 8 TRUNC(-8.9) = -8
Function - QUOTIENT() ä returns the integer portion of a division Syntax: QUOTIENT(number1, number2) Example QUOTIENT(5, 2) = 2 QUOTIENT(16, 4) = 4
Function - RAND() ä generates a random number x, where 0 < x < 1 Syntax:RAND()Example RAND() =
Date & Time Functions ä DATE() ä NOW() ä WEEKDAY()
Function - DATE() ä returns the (serial) number of a particular date Syntax: DATE(year, month, day) Example DATE(99, 3, 12)
Function - NOW() ä returns the (serial) number of the current date and time Syntax:NOW()
Function - WEEKDAY() ä returns weekday number of the current date Syntax:WEEKDAY() 1Sunday 2Monday 3Tuesday 4Wednesday 5Thursday 6Friday 7Saturday
Text Functions LEFT() RIGHT() MID() UPPER() LOWER() VALUE() EXACT() FIND() SEARCH() LEN() TRIM()CONCATENATE() CHAR()ISBLANK() PROPER()
Function - LEFT() ä copys character(s) from a string starting from left Syntax: LEFT(text, num) Example LEFT(“Final Fantasy”, 5) = “Final” number of char. to copy
Function - RIGHT() ä copy character(s) from a string starting from right Syntax: RIGHT(text, num) Example RIGHT(“Type-R”, 1) = “R” number of char. to copy
Function - MID() ä copy character(s) from a string, starting at the position you specify Syntax: MID(text, start_pos, num) Example MID(“R34 GT-R”, 5, 4) = “GT-R” number of char. to copy startingposition
Function - UPPER() ä converts all letters in a text string to uppercase Syntax:UPPER(text)Example UPPER(“toyota”) = “TOYOTA”
Function - LOWER() ä converts all letters in a text string to lowercase Syntax:LOWER(text)Example LOWER(“HONDA”) = “honda”
Function - TRIM() ä removes all spaces from text except for single spaces between words Syntax:TRIM(text)Example TRIM(“ Bio Hazard ”) = “Bio Hazard”
Function - CHAR() ä returns the character specified by the ASCII code Syntax:CHAR(num)Example CHAR(65) = “A” ASCIIcode
Function - VALUE() ä converts text to number Syntax:VALUE(text)Example VALUE(“2048”) = 2048
Function - EXACT() ä compares two strings and returns TRUE if they are exactly the same, FALSE otherwise Syntax: EXACT(text1, text2) Example EXACT(“IS200”, “IS 200”) = FALSE
Function - FIND() ä finds a string from another string, returns the position of the char. found Syntax: FIND(text1, text2, start_pos) Example FIND(“O”, “TOYOTA”, 3) = 4 FIND(“o”, “TOYOTA”) = ERROR
Function - SEARCH() ä similar to FIND, but the search string is not case sensitive Syntax: SEARCH(text1, text2, start_pos) Example SEARCH(“O”, “TOYOTA”, 3) = 4 SEARCH(“o”, “TOYOTA”) = 2
Function - PROPER() ä capitalizes the first letter in text. Converts all other letters to lowercase Syntax:PROPER(text)Example PROPER(“EXCEL is easy”) = “Excel Is Easy”
Function - CONCATENATE() ä join several text strings into one string Syntax: CONCATENATE(text1, text2,...) Example CONCATENATE(“EXCEL ”, “is easy”) = “EXCEL is easy”
Equivalent Operator - & ä join several text strings into one string Syntax: text1 & text2 &... Example “EXCEL ” & “is easy” = “EXCEL is easy”
Function - ISBLANK() ä test whether or not the cell is empty. Syntax:ISBLANK(val)Example ISBLANK(A15) = FALSE
Function - LEN() ä returns the length of a string. Syntax:LEN(text)Example LEN(“Excel”) = 5
Lookup Functions ä HLOOKUP ä VLOOKUP ä LOOKUP
Function - HLOOKUP() Syntax: HLOOKUP(lookup_value, lookup_range, row_num, matching) range TRUE : approx. match FALSE: exact match i.e., the row that returns the value
Function - HLOOKUP() When the value is found in the 1st row, returns the result from one of the rest of the row. Always lookup the 1st row
Function - VLOOKUP() Syntax : VLOOKUP(lookup_value, lookup_range, col_num, matching) range TRUE : approx. match FALSE: exact match i.e., the col. that returns the value
Function - VLOOKUP() Always lookup the 1st col When the value is found in the 1st col, returns the result from one of the rest of the col.
Function - LOOKUP() Syntax 1: LOOKUP(lookup_value, lookup_range, result_range) must be same size
Function - LOOKUP() - Syntax 1 lookup the value from m th row/col When the value is found in the m th row/col, returns the result from n th row/col. Note: Lookup range must be ordered Lookup and result range must have same size
Function - LOOKUP() Syntax 2: LOOKUP(lookup_value, range)
Function - LOOKUP() Notes ä Similar to HLOOKUP/VLOOKUP ä If cols <= rows (array/range size) then lookup 1st col ä If cols > rows (array/range size) then lookup 1st row ä Always return the last row/col
Function - LOOKUP() - Syntax 2 When the value is found in the 1st row/col, always returns the result from the last row/col. Always lookup the 1st row/col Note: cols <= rows, lookup 1st col cols > rows, lookup 1st rows
Macros ( 巨集 ) Definition: ä a sequence of instructions that tells Excel to do Purpose: ä automates repetitive tasks ä macro codes are stored in a Module sheet
Automatic Macro ä activates automatically whenever the workbook is opened ä In MS Excel, the name of automatic macro is “Auto_Open”
Ordinary Macro ä activates only when invoked by user
Macro Format Sub Macro_Name() Codes... End Sub
Macro Recorder ä the easiest way to create a macro Tools Macro Record New Macro ä enters macro name and starts recording
Running A Macro Tools Macro chooses macro and click “Run”
Editing A Macro ä chooses “Macro” from “Tools” menu ä chooses “Visual Basic Editor”