* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Arguments
Survey
Document related concepts
Transcript
FINAL CIS 300 TEST REVIEWS PROF. DOS SANTOS AGENDA 1. Logical Functions. 2. Mathematical Functions. 3. Statistical Functions. 4. Lookup Functions. 5. Date Functions. 6. Time Functions. 7. Text Functions. 8. Database Functions. 9. Sorting data by one and multiple columns. 10. Applying auto filter on one and multiple columns. 11. Calculating subtotals. 12. Applying advanced auto filters. 13. Pivot tables and Pivot charts. 14. Insert or delete a drop down list. 15. Access Review. MICROSOFT EXCEL LOGICAL FUNCTIONS AND =AND(logical1, [logical2], ...) OR =OR(logical1, [logical2], ...) NOT =NOT(logical) IF =IF(logical_test, [value_if_true], [value_if_false]) NESTEDIF IF( condition1, value_if_true, IF( condition2, value_if_true, value_if_false )) IFERROR 3 =IFERROR(value, value_if_error) THE FUNCTION Syntax: =AND(logical1, [logical2], ...) Arguments: •logical1 Required The first condition that you want to test that can evaluate to either TRUE or FALSE. •logical2, ... Optional Additional conditions that you want to test that can evaluate to either TRUE or FALSE, up to a maximum of 255 conditions. Description: •Returns FALSE if one or more arguments is FALSE 4 •Otherwise, all arguments must evaluate TRUE THE FUNCTION Syntax: =OR(logical1, [logical2], ...) Arguments: •logical1 Required The first condition that you want to test that can evaluate to either TRUE or FALSE. •logical2, ... Optional Additional conditions that you want to test that can evaluate to either TRUE or FALSE, up to a maximum of 255 conditions. Description: •Returns TRUE if one or more arguments is TRUE 5 •Otherwise, all arguments must evaluate FALSE THE FUNCTION Syntax: =NOT(logical) Arguments: •logical Required A value or expression that can be evaluated to TRUE or FALSE. Description: 6 •Reverses the value of its argument. THE FUNCTION Syntax: =IF(logical_test, [value_if_true], [value_if_false]) Arguments: 7 •logical_test Required Any value or expression that can be evaluated to TRUE or FALSE. •value_if_true Optional •The value that you want to be returned if the logical_test argument evaluates to TRUE. •If logical_test evaluates to TRUE and the value_if_true argument is omitted (that is, there is only a comma following the logical_test argument), the IF function returns 0 (zero). •To display the word TRUE, use the logical value TRUE for the value_if_true argument. THE FUNCTION Description: 8 •The IF function returns one value if a condition you specify evaluates to TRUE, and another value if that condition evaluates to FALSE. NESTED IF IN EXCEL A nested IF statement says something like... "If the answer is yes, do this. If the answer is no do this or this (depending on...“ Syntax: 9 IF( condition1, value_if_true, IF( condition2, value_if_true, value_if_false )) THE FUNCTION Syntax: =IFERROR(value, value_if_error) Arguments: • Value • Value_if_error Required. The value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!. Required. The argument that is checked for an error. Description: Returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula. Use the IFERROR function to trap and handle errors in a formula. 10 • Is there an employee named Daniel Handel? (Yes or No) =IF(C1="Handel"&B1="Daniel","yes","No") Microsoft ExcelMathematical Functions SUM =SUM(number1,[number2], ...) SUMIF =SUMIF(range,criteria,[sum_range]) SUMIFS =SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...) 12 ROUND =ROUND(number,num_digits) THE FUNCTION Syntax: =SUM(number1, [number2], [number3], [number4], ...) Arguments: •number1 Required The first item that you want to add. •number2, number3, number4, ... Optional The remaining items that you want to add, up to a total of 255 items. Description: 13 •Adds all the numbers that you specify as arguments. THE FUNCTION Syntax: =SUMIF(range, criteria, [sum_range]) Arguments: •range Required The range of cells that you want evaluated by criteria. oCells in each range must be numbers or names, arrays, or references that contain numbers. oBlank and text values are ignored. criteria Required The criteria in the form of a number, expression, a cell reference, text, or a function that defines which cells will be added. oCriteria can be expressed as 32, ">32", B5, "32", "apples", or TODAY(). •sum_range Optional The actual cells to add, if you want to add cells other than those specified in the range argument. oExcel adds the cells that are specified in the range argument (the same cells to which the criteria is applied). •Sums the values in a range that meet criteria that you specify. 14 Description: THE FUNCTION Syntax: SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...) Arguments: sum_range Required. One or more cells to sum, including numbers or names, ranges, or cell references that contain numbers. Blank and text values are ignored. criteria_range1 Required. The first range in which to evaluate the associated criteria. criteria1 Required. The criteria in the form of a number, expression, cell reference, or text that define which cells in the criteria_range1 argument will be added. For example, criteria can be expressed as 32, ">32", B4, "apples", or "32." criteria_range2, criteria2, … 15 Optional. Additional ranges and their associated criteria. Up to 127 range/criteria pairs are allowed. THE FUNCTION Description: Adds the cells in a range that meet multiple criteria. For example, if you want to sum the numbers in the range A1:A20 only if the corresponding numbers in B1:B20 are greater than zero (0) and the corresponding numbers in C1:C20 are less than 10, you can use the following formula: 16 =SUMIFS(A1:A20, B1:B20, ">0", C1:C20, "<10") IMPORTANT The order of arguments differ between the SUMIFS and SUMIF functions. In particular, thesum_range argument is the first argument in SUMIFS, but it is the third argument in SUMIF. If you are copying and editing these similar functions, make sure you put the arguments in the correct order THE FUNCTION Syntax: =ROUND(number, num_digits) Arguments: •number Required The number that you want to round. •num_digits Required The number of digits to which you want to round the number argument. Description: 17 •Rounds a number to a specified number of digits. AVERAGE =AVERAGE(number1, [number2],...) AVERAGEIF =AVERAGEIF(range, criteria, [average_range]) COUNT =COUNT(value1, [value2],...) COUNTIF =AVERAGEIF(range, criteria, [average_range]) COUNTIFS COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…) COUNTA =COUNTA(value1, [value2],...) MAX =MAX(number1,[number2],...) MIN =MIN(number1,[number2],...) LARGE =LARGE(array,k) SMALL =LARGE(array,k) 18 MICROSOFT EXCEL STATISTICAL FUNCTIONS THE FUNCTION Syntax: =AVERAGE(number1, [number2],...) Arguments: •number1 Required The first number, cell reference, or range for which you want the average. •number2, ... Optional Additional numbers, cell references or ranges for which you want the average, up to a maximum of 255. Description: 19 •Returns the average (arithmetic mean) of the arguments. THE FUNCTION Syntax: =AVERAGEIF(range, criteria, [average_range]) Arguments: •range Required One or more cells to average, including numbers or names, arrays, or references that contain numbers. •criteria Required The criteria in the form of a number, expression, cell reference, or text that defines which cells are averaged. •average_range Optional The actual set of cells to average. •Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria. 20 Description: THE FUNCTION Syntax: AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...) Arguments: •Average_range Required. One or more cells to average, including numbers or names, arrays, or references that contain numbers. •Criteria_range1, criteria_range2, … Criteria_range1 is required, subsequent criteria_ranges are optional. 1 to 127 ranges in which to evaluate the associated criteria. •Criteria1, criteria2, ... Criteria1 is required, subsequent criteria are optional. 1 to 127 criteria in the form of a number, expression, cell reference, or text that define which cells will be averaged. For example, criteria can be expressed as 32, "32", ">32", "apples", or B4. Description: 21 •Returns the average (arithmetic mean) of all cells that meet multiple criteria. THE FUNCTION Syntax: =COUNT(value1, [value2],...) Arguments: •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. Description: 22 •Counts the number of cells that contain numbers, and counts numbers within the list of arguments. THE FUNCTION Syntax: =COUNTIF(range, criteria) Arguments: •range Required One or more cells to count, including numbers or names, arrays, or references that contain numbers. oBlank and text values are ignored. criteria Required A number, expression, cell reference, or text string that defines which cells will be counted. oCriteria can be expressed as 32, ">32", B4, "apples", or "32". •Counts the number of cells within a range that meet a single criterion that you specify. 23 Description: THE FUNCTION Syntax: COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…) Arguments: • criteria_range1 Required. The first range in which to evaluate the associated criteria. • criteria1 Required. The criteria in the form of a number, expression, cell reference, or text that define which cells will be counted. For example, criteria can be expressed as 32, ">32", B4, "apples", or "32". • criteria_range2, criteria2, ... Optional. Additional ranges and their associated criteria. Up to 127 range/criteria pairs are allowed. IMPORTANT Each additional range must have the same number of rows and columns as the criteria_range1argument. The ranges do not have to be adjacent to each other. •Applies criteria to cells across multiple ranges and counts the number of times all criteria are met. 24 Description: THE FUNCTION Syntax: =COUNTA(value1, [value2],...) 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. Description: 25 •Counts the number of cells that are not empty in a range. THE FUNCTION Syntax: =MAX(number1,[number2],...) Arguments: •number1, number2, ... Required 1 to 255 numbers for which you want to find the maximum value. Description: 26 •Returns the largest value in a set of values. THE FUNCTION Syntax: =MIN(number1,[number2],...) Arguments: •number1, number2, ... Required 1 to 255 numbers for which you want to find the minimum value. Description: 27 •Returns the smallest value in a set of values. THE FUNCTION Syntax: =LARGE(array,k) Arguments: •array Required The array or range of data for which you want to determine the k-th largest value. k Required The position (from the largest) in the array or cell range of data to return. Description: 28 •Returns the k-th largest value in a data set. THE FUNCTION Syntax: =SMALL(array,k) Arguments: •array Required The array or range of data for which you want to determine the k-th smallest value. k Required The position (from the smallest) in the array or cell range of data to return. Description: 29 •Returns the k-th smallest value in a data set. MICROSOFT EXCEL LOOKUP FUNCTIONS VLOOKUP =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]) HLOOKUP = HLOOKUP(lookup_value,table_array,row_index_num,range_lookup) INDEX =INDEX(array,row_num,[column_num]) 30 MATCH =MATCH(lookup_value, lookup_array, [match_type]) THE FUNCTION Syntax: =VLOOKUP(lookup_value,table_array,col_index_num,[range_lookup]) Arguments: •lookup_value Required The value to search in the first column of the table or range. •table_array Required The range of cells that contains the data. •col_index_num Required The column number in the table_array argument from which the matching value must be returned. •range_lookup Optional A logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match. •Searches the first column of a range of cells, and then returns a value from any cell on the same row of the range. 31 Description: THE FUNCTION Syntax: = HLOOKUP(lookup_value,table_array,row_index_num,range_lookup) Arguments: • Searches for a value in the top row of a table or an array of values, and then returns a value in the same column from a row you specify in the table or array. 32 •lookup_value Required The value to search in the first row of the table or range. •table_array Required The range of cells that contains the data. •row_index_num Required The row number in table_array from which the matching value will be returned range_lookup Optional. A logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not found, the error value #N/A is returned. Description: THE FUNCTION Syntax: =INDEX(array,row_num,[column_num]) Arguments: •array Required A range of cells or an array constant. •row_num Optional Selects the row in array from which to return a value. oIf row_num is omitted, column_num is required. •column_num Optional Selects the column in array from which to return a value. oIf column_num is omitted, row_num is required. Description: • Returns the value of an element in a table or an array, selected by the row and column number indexes. Microsoft® Excel® Lookup Functions THE FUNCTION Syntax: =MATCH(lookup_value, lookup_array, [match_type]) Arguments: •lookup_value Required The value that you want to match in lookup_array. •lookup_array Required The range of cells being searched. •match_type Optional Specifies how Excel matches lookup_value with values in lookup_array. oThe number -1, 0, or 1 Description: • Searches for a specified item in a range of cells, and then returns the relative position of that item in the range Microsoft® Excel® Lookup Functions MICROSOFT EXCEL DATE FUNCTIONS DATE =DATE(year,month,day) YEAR =YEAR(serial_number) MONTH =MONTH(serial_number) DAY =DAY(serial_number) TODAY =TODAY() NOW =NOW() DATEDIF =DATEDIF(startdate,enddate,interval) 35 YEARFRAC =YEARFRAC(start_date,end_date,[basis]) THE FUNCTION Syntax: =DATE(year,month,day) Arguments: •year Required The value of the year argument can include one to four digits. •month Required A positive or negative integer representing the month of the year from 1 to 12 (January to December). •day Required A positive or negative integer representing the day of the month from 1 to 31. Description: • Returns the sequential serial number that represents a particular date. Microsoft® Excel® Date Functions THE FUNCTION Syntax: =YEAR(serial_number) Arguments: •serial_number Required The date of the year you want to find. Description: • Returns the year corresponding to a date. Microsoft® Excel® Date Functions THE FUNCTION Syntax: =MONTH(serial_number) Arguments: •serial_number Required The date of the month you want to find. Description: • Returns the month of a date represented by a serial number. Microsoft® Excel® Date Functions THE FUNCTION Syntax: =DAY(serial_value) Arguments: •serial_value Required The date of the day you want to find. Description: • Returns the day of a date, represented by a serial number. Microsoft® Excel® Date Functions THE FUNCTION Syntax: =TODAY() Arguments: None Description: • Returns the serial number of the current date. Microsoft® Excel® Date Functions THE FUNCTION Syntax: =NOW() Arguments: None Description: • Returns the serial number of the current date and time. Microsoft® Excel® Date Functions THE FUNCTION Syntax: =YEARFRAC(start_date,end_date,[basis]) Arguments: •start_date Required A date that represents the start date. •end_date Required A date that represents the end date. •basis Optional The type of day count basis to use. Description: • Calculates the fraction of the year represented by the number of whole days between two dates (the start_date and the end_date). Microsoft® Excel® Date Functions THE COUNT BASIS FUNCTION-DAY 0 – This value is used for US (NASD) date systems that assume 30 days are in a month and 360 days are in one year. If no basis value is specified, a value of 0 is used. 1 – A value of 1 should be used for the basis if you want your calculations based on the actual number of days in any given month or year. 2 – This value uses the actual number of days in any given month but assumes there are only 360 days in a year. 3 – This value is similar to the previous option as it uses the actual number of days in any given month, but it assumes there are 365 days in each year. That is, it disregards leap years. 4 – This value is similar to 0 (30 days in each month and 360 days in a year), but it assumes a European date system. THE FUNCTION Syntax: =DATEDIF(startdate,enddate,interval) Arguments: •startdate Required A date that represents the start date. •enddate Required A date that represents the end date. •interval Required The type of day count basis to use. Microsoft® Excel® Date Functions THE FUNCTION Arguments: •interval Required The type of day count basis to use. Description: • Computes the difference between two dates in a variety of different intervals. Microsoft® Excel® Date Functions MICROSOFT EXCEL TIME FUNCTIONS HOUR =HOUR(serial_number) MINUTE =MINUTE(serial_number) SECOND =SECOND(serial_number) THE FUNCTION Syntax: =HOUR(serial_number) Arguments: •serial_number Required The time that contains the hour you want to find. Description: • Returns the hour of a time value. Microsoft® Excel® Time Functions THE FUNCTION Syntax: =MINUTE(serial_number) Arguments: •serial_number Required The time that contains the minute you want to find. Description: • Returns the minutes of a time value. Microsoft® Excel® Time Functions THE FUNCTION Syntax: =SECOND(serial_number) Arguments: •serial_number Required The time that contains the seconds you want to find. Description: • Returns the seconds of a time value. Microsoft® Excel® Time Functions MICROSOFT EXCEL TEXT FUNCTIONS FIND =FIND(find_text,within_text,[start_num]) LEFT =LEFT(text,[num_chars]) LEN =LEN(text) RIGHT =RIGHT(text,[num_chars]) CONCATENATE (including &) =CONCATENATE(text1, [text2], ...) UPPER =UPPER(text) LOWER =LOWER(text) PROPER =PROPER(text) TRIM =TRIM(text) MID =MID(text, start_num, num_chars) THE FUNCTION Syntax: =FIND(find_text,within_text,[start_num]) Arguments: •find_text Required The text you want to find. •within_text Required The text string containing the text you want to find. •start_num Optional Specifies the character at which to start the search. Description: • Locates one text string within a second text string, and returns the number of the starting position of the first text string from the first character of the second text string Microsoft® Excel® Text Functions THE FUNCTION Syntax: =LEFT(text,[num_chars]) Arguments: •text Required The text string that contains the characters you want to extract. •num_chars Optional Specifies the number of characters you want LEFT to extract. Description: • Returns the first character or characters in a text string, based on the number of characters you specify Microsoft® Excel® Text Functions THE FUNCTION Syntax: =LEN(text) Arguments: •text Required The text whose length you want to find. Description: • Returns the number of characters in a text string. Microsoft® Excel® Text Functions THE FUNCTION Syntax: =RIGHT(text,[num_chars]) Arguments: •text Required The text string that contains the characters you want to extract. •num_chars Optional Specifies the number of characters you want RIGHT to extract. Description: • Returns the last character or characters in a text string, based on the number of characters you specify. Microsoft® Excel® Text Functions THE FUNCTION Syntax: =CONCATENATE(text1, [text2], ...) Arguments: •text1 Required The first text item to be concatenated. •text2 Optional Additional text items, up to a maximum of 255 items, which must be separated by commas. Description: • Joins up to 255 text strings into one text string. Microsoft® Excel® Text Functions THE FUNCTION Syntax: =UPPER(text) Arguments: •text Required The text you want converted to uppercase. Description: • Converts text to uppercase. Microsoft® Excel® Text Functions THE FUNCTION Syntax: =LOWER(text) Arguments: •text Required The text you want converted to lowercase. Description: • Converts all uppercase letters in a text string to lowercase. Microsoft® Excel® Text Functions THE FUNCTION Syntax: =PROPER(text) Arguments: •text Required Text enclosed in quotation marks, a formula that returns text, or a reference to a cell containing the text you want to partially capitalize. Description: • Capitalizes the first letter in a text string and any other letters in text that follow any character other than a letter. Microsoft® Excel® Text Functions THE FUNCTION Syntax: =TRIM(text) Arguments: •text Required is the text from which you want spaces removed. Description: Removes all spaces from text except for single spaces between words. Use TRIM on text that you have received from another application that may have irregular spacing. Microsoft® Excel® Text Functions THE FUNCTION Syntax: =MID(text, start_num, num_chars) Arguments: Text Required. The text string containing the characters you want to extract. Start_num Required. The position of the first character you want to extract in text. The first character in text has start_num 1, and so on. Num_chars Required. Specifies the number of characters you want MID to return from text. Description: • MID returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify. Microsoft® Excel® Text Functions MICROSOFT EXCEL DATABASE FUNCTIONS DAVERAGE =DAVERAGE(database,field,criteria) DCOUNT =DCOUNT(database,field,criteria) DMAX =DMAX(database,field,criteria) DMIN =DMIN(database,field,criteria) DSUM =DSUM(database,field,criteria) THE FUNCTION Syntax: =DAVERAGE(database,field,criteria) Arguments: •database Required The range of cells that makes up the list or database. •field Required Indicates which column is used in the function. •criteria Required The range of cells that contains the conditions you specify. Description: •Averages the values in a field (column) of records in a list or database that match conditions you specify. Microsoft® Excel® Database Functions THE FUNCTION The average yield of apple trees over 10 feet in height. =DAVERAGE(A4:E10,"Yield",A1:B2) Microsoft® Excel® Database Functions THE FUNCTION The average yield of apple trees over 10 feet in height. =DAVERAGE(A4:E10,"Yield",A1:B2) Microsoft® Excel® Database Functions THE FUNCTION The average yield of apple trees over 10 feet in height. =DAVERAGE(A4:E10,"Yield",A1:B2) Microsoft® Excel® Database Functions THE FUNCTION The average yield of apple trees over 10 feet in height. =DAVERAGE(A4:E10,"Yield",A1:B2) Microsoft® Excel® Database Functions THE FUNCTION The average yield of apple trees over 10 feet in height. =DAVERAGE(A4:E10,"Yield",A1:B2) =12 Microsoft® Excel® Database Functions THE FUNCTION The average age of all trees in the database. =DAVERAGE(A4:E10,3,A4:E10) Microsoft® Excel® Database Functions THE FUNCTION The average age of all trees in the database. =DAVERAGE(A4:E10, 3,A4:E10) Microsoft® Excel® Database Functions THE FUNCTION The average age of all trees in the database. =DAVERAGE(A4:E10, 3,A4:E10) Microsoft® Excel® Database Functions THE FUNCTION The average age of all trees in the database. =DAVERAGE(A4:E10, 3,A4:E10) Microsoft® Excel® Database Functions THE FUNCTION The average age of all trees in the database. =DAVERAGE(A4:E10, 3,A4:E10) =13 Microsoft® Excel® Database Functions THE FUNCTION The maximum profit of apple and pear trees. =DMAX(A4:E10,"Profit",A1:A3) Microsoft® Excel® Database Functions THE FUNCTION The maximum profit of apple and pear trees. =DMAX(A4:E10,"Profit",A1:A3) Microsoft® Excel® Database Functions THE FUNCTION The maximum profit of apple and pear trees. =DMAX(A4:E10,"Profit",A1:A3) Microsoft® Excel® Database Functions THE FUNCTION The maximum profit of apple and pear trees. =DMAX(A4:E10,"Profit",A1:A3) Microsoft® Excel® Database Functions THE FUNCTION The maximum profit of apple and pear trees. =DMAX(A4:E10,"Profit",A1:A3) =105 Microsoft® Excel® Database Functions THE FUNCTION The minimum profit of apple trees over 10 in height. =DMIN(A4:E10,"Profit",A1:B2) Microsoft® Excel® Database Functions THE FUNCTION The minimum profit of apple trees over 10 in height. =DMIN(A4:E10,"Profit",A1:B2) Microsoft® Excel® Database Functions THE FUNCTION The minimum profit of apple trees over 10 in height. =DMIN(A4:E10,"Profit",A1:B2) Microsoft® Excel® Database Functions THE FUNCTION The minimum profit of apple trees over 10 in height. =DMIN(A4:E10,"Profit",A1:B2) Microsoft® Excel® Database Functions THE FUNCTION The minimum profit of apple trees over 10 in height. =DMIN(A4:E10,"Profit",A1:B2) =75 Microsoft® Excel® Database Functions THE FUNCTION This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. =DCOUNT(A4:E10,"Age",A1:F2) Microsoft® Excel® Database Functions THE FUNCTION This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. =DCOUNT(A4:E10,"Age",A1:F2) Microsoft® Excel® Database Functions THE FUNCTION This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. =DCOUNT(A4:E10,"Age",A1:F2) Microsoft® Excel® Database Functions THE FUNCTION This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. =DCOUNT(A4:E10,"Age",A1:F2) Microsoft® Excel® Database Functions THE FUNCTION This function looks at the records of apple trees between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. =DCOUNT(A4:E10,"Age",A1:F2) =1 Microsoft® Excel® Database Functions THE FUNCTION The total profit from apple trees. =DSUM(A4:E10,"Profit",A1:A2) Microsoft® Excel® Database Functions THE FUNCTION The minimum profit of apple trees over 10 in height. =DSUM(A4:E10,"Profit",A1:A2) Microsoft® Excel® Database Functions THE FUNCTION The minimum profit of apple trees over 10 in height. =DSUM(A4:E10,"Profit",A1:A2) Microsoft® Excel® Database Functions THE FUNCTION The minimum profit of apple trees over 10 in height. =DSUM(A4:E10,"Profit",A1:A2) Microsoft® Excel® Database Functions THE FUNCTION The minimum profit of apple trees over 10 in height. =DSUM(A4:E10,"Profit",A1:A2) =225 Microsoft® Excel® Database Functions SORTING DATA BY ONE AND MULTIPLE COLUMNS 1. Select the data that you want to sort Select a range of data, such as A1:L5 (multiple rows and columns) or C1:C80 (a single column). The range can include titles that you created to identify columns or rows. 2. Sort quickly 1. Select a single cell in the column on which you want to sort. 2. Click Button Image to perform an ascending sort (A to Z or smallest number to largest). 93 3. Click to perform a descending sort (Z to A or largest number to smallest). SORTING DATA BY ONE AND MULTIPLE COLUMNS 3. Sort by specifying criteria You can choose the columns on which to sort by clicking the Sort command in the Sort & Filter group on the Data tab. 1. Select a single cell anywhere in the range that you want to sort. 2. On the Data tab, in the Sort & Filter group, click Sort. The Sort dialog box appears. 3. In the Sort by list, select the first column on which you want to sort. 4. In the Sort On list, select either Values, Cell Color, Font Color, or Cell Icon. 94 5. In the Order list, select the order that you want to apply to the sort operation — alphabetically or numerically ascending or descending (that is, A to Z or Z to A for text or lower to higher or higher to lower for numbers). APPLYING AUTO-FILTER ON ONE AND MULTIPLE COLUMNS By filtering information in a worksheet, you can find values quickly. You can filter on one or more columns of data. With filtering, you can control not only what you want to see, but what you want to exclude. You can filter based on choices you make from a list, or you can create specific filters to focus on exactly the data that you want to see. 95 When you filter data, entire rows are hidden if values in one or more columns don't meet the filtering criteria. APPLYING AUTO-FILTER ON ONE AND MULTIPLE COLUMNS 1. Select the data that you want to filter 1. On the Data tab, in the Sort & Filter group, click Filter. 2. Click the arrow in the column header to display a list in which you can make filter choices. 96 Note Depending on the type of data in the column, Microsoft Excel displays either Number Filters or Text Filters in the list. APPLYING AUTO-FILTER ON ONE AND MULTIPLE COLUMNS 2. Filter by selecting values or searching 97 Selecting values from a list and searching are the quickest ways to filter. When you click the arrow in a column that has filtering enabled, all values in that column appear in a list. APPLYING AUTO-FILTER ON ONE AND MULTIPLE COLUMNS 1 Use the Search box to enter text or numbers on which to search 2 Select and clear the check boxes to show values that are found in the column of data 3 Use advanced criteria to find values that meet specific conditions 1. To select by values, in the list, clear the (Select All) check box. This removes the check marks from all the check boxes. Then, select only the values you want to see, and click OK to see the results. 98 2. To search on text in the column, enter text or numbers in the Search box. Optionally, you can use wildcard characters, such as the asterisk (*) or the question mark (?). Press ENTER to see the results. APPLYING AUTO-FILTER ON ONE AND MULTIPLE COLUMNS 3. Filter data by specifying conditions 1. Point to either Number Filters or Text Filters in the list. A menu appears that allows you to filter on various conditions. 2. Choose a condition and then select or enter criteria. Click the And button to combine criteria (that is, two or more criteria that must both be met), and the Or button to require only one of multiple conditions to be met. 3. Click OK to apply the filter and get the results you expect. 99 By specifying conditions, you can create custom filters that narrow down the data in the exact way that you want. You do this by building a filter. If you've ever queried data in a database, this will look familiar to you. CALCULATING SUBTOTALS You can use Excel 2010's Subtotals feature to subtotal data in a sorted list. To subtotal a list, you first sort the list on the field for which you want the subtotals, and then you designate the field that contains the values you want summed — these don't have to be the same fields in the list. Excel does not allow you to subtotal a list formatted as a table. 100 You must first convert your table into a normal range of cells. CALCULATING SUBTOTALS How to add a subtotal to a worksheet? 1. Sort the list on the field for which you want subtotals inserted. 101 2. Click the Subtotal button in the Outline group on the Data tab. CALCULATING SUBTOTALS 3. Select the field for which the subtotals are to be calculated in the At Each Change In drop-down list. 4. Specify the type of totals you want to insert in the Use function dropdown list. When you use the Subtotals feature, you aren't restricted to having the values in the designated field added together with the SUM function. You can instead have Excel return the number of entries with the COUNT function, the average of the entries with the AVERAGE function, the highest entry with the MAXIMUM function, the lowest entry with the MINIMUM function, or even the product of the entries with the PRODUCT function. 5. Select the check boxes for the field(s) you want to total in the Add Subtotal To list box. 102 6. Click OK. CALCULATING SUBTOTALS 103 Excel adds the subtotals to the worksheet. APPLYING ADVANCED AUTO-FILTERS 104 Insert at least three blank rows above the range that can be used as a criteria range. The criteria range must have column labels. Make sure there is at least one blank row between the criteria values and the range. APPLYING ADVANCED AUTO-FILTERS 105 In the rows below the column labels, type the criteria you want to match. APPLYING ADVANCED AUTO-FILTERS 1. Click a cell in the range. 2. On the Data menu, point to Filter, and then click Advanced Filter. 3. To filter the range by hiding rows that don't match your criteria, click Filter the list, in-place. To filter the range by copying rows that match your criteria to another area of the worksheet, click Copy to another location, click in the Copy to box, and then click the upper-left corner of the area where you want to paste the rows. 4. In the Criteria range box, enter the reference for the criteria range, including the criteria labels.(A1:C3) To move the Advanced Filter dialog box out of the way temporarily while you select the criteria range, clickCollapse Dialog . 106 5. To change how the data is filtered, change the values in the criteria range and filter the data again. PIVOT TABLES & PIVOT CHARTS 107 Excel 2010 has an option of creating pivot table, as name implies it pivots down the existing data table and tries to make user understand the crux of it. PIVOT TABLES & PIVOT CHARTS 108 To start out with making pivot table, make sure that all rows and columns are selected. Navigate to Insert tab, click PivotTable. PIVOT TABLES & PIVOT CHARTS You will reach Create Pivot Table dialog box. Excel fills in data range from first to last selected columns and rows. You can also specify any external data source to be used. Finally choose worksheet to save the pivot table report. 109 Click OK to proceed further PIVOT TABLES & PIVOT CHARTS Pivot table will appear. 110 Now we will populate this table with data fields which is being present at the right side of the Excel window. PIVOT TABLES & PIVOT CHARTS We start off with enabling Platform field, and then other fields. 111 Excel start filling cells in a sequence you want to populate. The Platform field will come first in the Pivot Table as shown in screen shot. PIVOT TABLES & PIVOT CHARTS For creating chart of pivot table, go to Insert tab, click Column select an appropriate chart type. 112 In this example we will create a simple 3-D Column chart. PIVOT TABLES & PIVOT CHARTS 113 Chart content can be changed by using the options at the bottom-left of its area. INSERT OR DELETE A DROPDOWN LIST To make data entry easier in Excel, or to limit entries to certain items that you define, you can create a drop-down list of valid entries that is compiled from cells elsewhere in the workbook. To create a drop-down list from a range of cells, use the Data Validationcommand in the Data Tools group on the Data tab. 114 1. To create a list of valid entries for the drop-down list, type the entries in a single column or row without blank cells. For example: INSERT OR DELETE A DROPDOWN LIST 2. NOTE You may want to sort the data in the order that you want it to appear in the drop-down list. 3. If you want to use another worksheet, type the list on that worksheet, and then define a name for the list. 4. Select the cell where you want the drop-down list. 5. On the Data tab, in the Data Tools group, click Data Validation. 115 6. In the Data Validation dialog box, click the Settings tab. INSERT OR DELETE A DROPDOWN LIST 7. In the Allow box, click List. 8. To specify the location of the list of valid entries, do one of the following: • If the list is in the current worksheet, enter a reference to your list in the Source box. • If the list is on a different worksheet, enter the name that you defined for your list in the Source box. 116 9. Make sure that the In-cell dropdown check box is selected Access Review DATABASE DESIGN Basic Terminology: A table consists of data that is arrayed in rows and columns. A row of data is called a record. A column of data is called a field. Thus, a record is a set of related fields. The fields in a table 118 should be related to one another in some way. BASIC TERMINOLOGY Primary key field is a field in which each record has a unique value. e.g. The SSN Compound Primary Key is used when there is no single field whose values are all different. In that case, two or more fields are combined. The combination of the fields’ values should be unique. Foreign key is the primary key of another table. 119 e.g. suppose we need to link the employee table with the Hours worked table for payroll purposes. The Employee ID number (EIN) is the primary key of the employees table but the foreign key of the hours worked table. BASIC TERMINOLOGY A form is a database object that is created from an existing table to make the process of entering data more user-friendly A query is the database equivalent of a question that is posed about data in a table (or tables). 120 Queries can be designed to search multiple tables but these tables should be connected by a join operation. DATABASE DESIGN Database design concepts: Entities an entity is a tangible thing or an event. It is a person, place, thing or concept about which data can be collected. Consider the following examples: 1) The database of a video store would have one entity named video and another named customer (These are physical entities). 2) Organizations incur expenses from paying hourly employees and purchasing materials from suppliers. Hours worked and purchases are event entities in the database of most organizations. 3) The library lends books for free. If you were to think of checking out a book as a sales transaction for zero revenue, how would you handle the revenue generating event? 121 The event entity here is the number of checkouts. DATABASE DESIGN Relationships you should consider the relationship of each entity to the other entities you have identified. Cardinality of any relationship can be one-to-one, one-tomany, or many-to-many. A one-to-one relationship is like A book is published by one company or A shark lives in one place (the ocean). There is a many-to-many relationship between the records in the doctor table and records in the patient table because doctors have many patients, and a patient could have several doctors; 122 A one-to-many relation between the department table and the doctor table because each doctor may work for only one department, but one department could have many doctors. DATABASE DESIGN A book can have more than one author. An author can write more than one book. How would you describe the relationship between authors and books? Many-to-many A member can borrow any number of books at one checkout. A book can be checked out more than once. How would you describe the relationship between books and checkouts? 123 Many-to-many DATABASE DESIGN Attributes an attribute is a characteristic of an entity. These attributes become the table’s field. E.g. what are the attributes for the entity “Customer”? Customer ID, First name, Surname, Date of Birth, Address and Phone no. What are the attributes for the entity “Fashion Model”? 124 Name, Height, Weight, Dress size, Hair color and Eye color. DATABASE DESIGN RULES Rule 1: You do not need a table for the business The database represents the entire business. Thus in the practice example* The library is not an entity. *practice problem at the end of tutorial A. Rule 2: Identify the entities in the business description 125 In our example the entities are Members, employees and books. DATABASE DESIGN RULES Rule 3: Look for relationships among the entities look for relationships between entities; one-to-many and many-to-many. In our example: one-to-many: a member can check out more than one book. Rule 4: Look for attributes of each entity and designate a primary key. Primary Key Attributes of members: name, DOB, phone no., email address, member ID card number …etc. Employees: name, # of hours worked, job title,…etc. Foreign key 126 Books: name, authors, type, status, member ID card number…etc. DATABASE DESIGN RULES Rule 5: Avoid data redundancy you should not include extra (redundant) fields in a table. Redundant fields take up extra disk space and lead to data entry errors because the same value must be entered in multiple tables. Rule 6: Do not include a field if it can be calculated from other fields 127 A calculated field is made using the query generator as we will see later. CREATING TABLES Create tab Table design (in the tables group) Fill in the table’s fields. 128 Change the lengths of the text fields from 255 to 30 spaces. CREATING TABLES We need to make the Employee ID a primary key: Select the Employee ID field then in the Table tools Design click Primary Key tab After you finish click the File tab Save object as then name your table 129 Note that this is different from Save Database as which saves the whole database. CREATING COMPOUND PRIMARY KEY The two fields must be appear one after the other in the table definition screen (plan ahead for that format). Highlight one field, hold down the control key and highlight the next field. 130 Go to table tools design tab Primary Key ADDING RECORDS TO A TABLE Double click the table’s name in the navigation pane at the left of the screen then start typing data directly into the cells. Enter your data one field value at a time. Each time you finish entering a value, press Enter to move the cursor to the next cell. After you enter the data in the last cell in a row, the cursor moves to the first cell in the next row and Access automatically saves the record 131 No need to save through the File tab. CREATING QUERIES Using Calculated Fields in Queries: E.g. suppose we have the following table. 132 if you have an existing field containing the number of boxes of Girl Scout cookies sold, you may want to see how much money was collected for each cookie sale. In this example, the boxes sold for $3.95 each. USING CALCULATED FIELDS IN QUERIES In this case we will create a calculated field in a query. Create tab Query design Don’t Forget the Colon. 133 Also the field name must be enclosed in square brackets. USING CALCULATED FIELDS IN QUERIES How to format the calculated field output? 1. select the output column by clicking the line above the calculated field expression. 2. the column darkens to indicate the selection. 134 3. Design tab property sheet format AVOIDING ERRORS WHEN MAKING CALCULATED FIELDS 1. Do not enter the expression in the criteria cell. Enter it in the Field cell. 2. Spell, capitalize, and space a field’s name exactly as you did in the table definition. 135 3. Don’t use parentheses or curly braces instead of the square brackets. “RELATING” TWO OR MORE TABLES BY THE JOIN OPERATION Suppose you want to see the last names, employee IDs, wage rates, salary status, and citizenship only for US citizens and hourly workers. Problem: the data is spread across two tables. Solution: add both tables and pull down the five fields you need. Step 1: Create tab Query design Step 2: Click one table name and hold down the ctrl button while choosing the other table name. 136 Step 3: start pulling down the fields you need and add the criteria expressions. TWO OR MORE TABLES BY THE JOIN OPERATION 137 “RELATING” “RELATING” TWO OR MORE TABLES BY THE JOIN OPERATION you can use calculated fields using more than one table. Just follow the same steps and add the calculated field in the 138 design view like what we did earlier. TOTALS QUERIES Assume that you want to see two pieces of information for hourly workers: 1. The average wage rate 2. 110 percent of the average rate Step1: Create the first query, click the design tab Totals button in the show/hide group. This will give us the average of the wage rate field. Note that: you should type the revised heading for the wage rate field, i.e. Average rate: wage rate. N.B. we need the average of this field. 139 Also to get the hourly workers only, enter Criteria=No. TOTALS QUERIES Now begin a new Query. But instead of basing it on a table, we will base it on the previous query. 140 Design the new query and create a calculated field inside it. USING THE DATE() FUNCTION IN QUERIES Access has two important date function features: 1. The built in Date() function which gives today’s date. 2. Date arithmetic lets you subtract one date from another to obtain the difference-in number of days- between two 141 calendar dates. USING THE DATE() FUNCTION IN QUERIES Suppose you want to give each employee a $1 bonus for each day the employee has worked. So, you need to calculate the number of days between the employee’s date of hire and the date the query is run. 142 Date arithmetic USING TIME ARITHMETIC IN QUERIES Access allows you to subtract the values of time fields to get an elapsed time. 143 In Access, subtracting one time from the other yields the decimal portion of a 24-hour day. E.g. if the employee worked 8 hours, the time arithmetic function yields 0.333. That’s why we multiply by 24. UPDATING QUERIES Suppose you want to give all non-salaried workers a $0.5 pay raise. If you have 3 workers change the wage rate data in the table. If you have 3000 workers it would be much faster and more accurate to change the wage rate by using an update query that adds $0.5 to each non-salaried employee’s wage 144 rate. UPDATING QUERIES First start by making a select query. 145 Then click the update button in the query type group. UPDATING QUERIES We will update only the nonsalaried workers by using a filter under the salaried field. 146 We will write the updated data in the Update to line in the QBE grid. UPDATING QUERIES When you run the query, the following warning message will appear. 147 Click yes, and the records will be updated. DELETING QUERIES Delete queries work like the update queries. E.g. Suppose your company is purchased by the state of Delaware. So you need to delete or “fire” all employees who are not exclusively Delaware residents. 148 <> not SCENARIO You have a table of medicines. One of them is now banned. Create a query with the new requirements. So what is the type of this query? 149 Delete Query PARAMETER QUERIES Suppose you want to know how many hours a particular employee has worked. 1. Run a select query. 150 2. You will get a message to enter the employee ID. Enter your employee ID and you will get the desired information PRACTICE QUERIES (P.33 37) 151 #2 Create a query that shows the last name, first name, date hired, and state for employees who live in Delaware or were hired after 12/31/99. The primary sort (ascending) is on last name, and the secondary sort (ascending) is on first name. The primary sort field must be to the left of the Secondary sort field in the query setup. N.B. you have 3 tables. Employee Last Name, First Name, Employee ID, Street Address, City, State, Zip, Date Hired, Us Citizen. Wage Data Employee ID, Wage Rate, Salaried. Hours Worked Employee ID, Week #, Hours. Use this table to solve the practice query. Field Table Sort Show Criteria 152 Or: ANSWER TO PRACTICE QUERY #2 Field Last Name First Name Date Hired State Table Employee Employee Employee Employee Sort Ascending Ascending >#12/31/1999# =“DE” Show Criteria 153 Or: PRACTICE QUERIES #6 Create a parameter query that shows the hours employees have worked. Have the parameter query prompt for the week number. The output headings should be Last Name, First Name, Week #, and hours. This query is for non-salaried employees only. N.B. you have 3 tables. Employee Last Name, First Name, Employee ID, Street Address, City, State, Zip, Date Hired, Us Citizen. Wage Data Employee ID, Wage Rate, Salaried. Hours Worked Employee ID, Week #, Hours. Field Table Show Criteria Or: 154 Sort ANSWER TO PRACTICE QUERY #6 Field Last Name First Name Week # Hours Salaried Table Employee Employee Hours Worked Hours Worked Wage Date Sort Show Criteria [Enter Week #] =No 155 Or: CREATING REPORTS Create basic ungrouped report: 156 Select the table create tab report CREATING REPORTS Create Grouped Report: Design tab Group and Sort button in the grouping and tools group. 157 Click the Add group button then select the desired table (Employee ID) CREATING REPORTS To total the hours worked by each employee: select the Hours column heading. Then on the Design tab totals button in the grouping and totals group Sum 158 Layout View CREATING REPORTS Design tab Report view from the views group 159 Report view (final view) IMPORTING DATA Open the Excel application and create a spreadsheet. 160 In the Access application: External data tab Excel in the import and link group 161 IMPORTING DATA Choose the correct worksheet Make sure to select the first row contains column headings box 162 IMPORTING DATA Choose the default settings for each field you are importing 163 IMPORTING DATA IMPORTING DATA Choose an appropriate name for your table 164 *you can change your table design from Design button MAKING FORMS First select the table or query you want to base the form on then select Create tab form When you create a form within another form this is called a subform The Subform is useful when the form is based on one or 165 more tables. MAKING FORMS Step 1: select the table create Form 166 Take the form into design view. Design tab make sure that the use control wizard option is selected click the subform/subreport button. MAKING FORMS Use your cursor to stretch out the box under your main menu. This dialog box will appear 167 Select use existing tables and Queries Next MAKING FORMS 168 Choose the required table from the list Next select choose from a list Next Finish. Problems 170 171