Functions
Types of Functions Built-in functions: –Financial –Date & time –Math & statistical –Database –Lookup –Logical –Information:IsBlank, IsNumber, IsText –Text –Etc.
Arguments Arguments are inputs to a function. A function may or may not require arguments. –Example: No argument: Today() One argument: –IsBlank(A1) –Upper(“David”) More than one: PMT
A few math functions Int(x): Rounds a number down to the nearest integer –Int(2.3) = 2 –Int(5.6) = 5 –Int(-2.7) = -3 QUOTIENT(numerator,denominator) –Returns the integer portion of a division –Numerator is the dividend. –Denominator is the divisor. MOD(Dividend, Divisor) –Returns the remainder of a division
Examples of Using Int Function Remainder function: MOD(Dividend, Divisor)
Rounding ROUND(number, num_digits) –It rounds a number to a specified number of digits. ROUNDUP(number,num_digits) ROUNDDOWN(number,num_digits)
Currency Format & Rounding Example: –Enter in cell A1and enter in cell A2 –Enter Sum(A1:A2) in cell A3 –Assign currency format with 2 decimals to A1:A3 Stored value and displayed value
Statistical Functions Sum, Average, Max, Min, Count –Ignore text and logical values. SumA, AverageA, MaxA, MinA, CountA –Does not ignore text and logical values: Text -> 0 True -> 1 False -> 0 Can have many arguments: =SUM(A1:A3, 12, B3:B7)
Using Statistical Functions Compute each student’s: 1.Best score, Lowest score, exam average 2.Average of the best 2 scores 3. Weighted avg: 50%*Best score + 30% * 2 nd best + 20%*lowest
Compute each student’s: Best score, Lowest score, exam average Average of the best 3 scores Average of the best 2 scores
Large(Data range, kth value) Returns the k-th largest value in a range. Average of the best two exams: –=(Large(B2:E2,1) + Large(B2:E2,2))/2
Average Excluding the Highest and the lowest Scores
Text Operator Concatenation: & –Join two or more text values into a single text value.
Text Functions Concatenate(text1, text2,…) Lower(text): Lower(“David”) -> “david” Upper(text): Upper(“David”) -> “DAVID” Right(text, #ofCHars) Right(“David”, 4) -> ”avid” Left(text, #ofChars) Left(“David”, 2) -> “Da” Len(text) -> the number of characters in a text. Len(“David”) -> 5
The first letter in uppercase and all other letters in lowercase
The first letter in each word in uppercase and other in lower case Proper(text)
Financial Functions Payment: PMT Interest payment: IPMT Principal payment: PPMT Cumulative interest:CUMIPMT Cumulative principal payment: CUMPRIC
A few interesting formatting skills Home –Font group: Border, Fill Color, Font Color –Style group: Cell Style, Conditional Formatting –Alignment: Merge Page layout –Themes –Page Setup group: Background –Sheet Options group: View Gridline