session 1 – tables, ranges, and databases · web viewmicrosoft excel knowledge source: smart, m....

32
MICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method . United States: Smart Method. Exercises have been done in Excel 2016. Contents SESSION 1 – Tables, Ranges, and Databases.......................................2 SESSION 2 – Data Integrity, Subtotals and Validations...........................5 SESSION 3 – Advanced Functions.................................................. 8 SESSION 4 – Using Names and the Formula Auditing Tools.........................13 SESSION 5 – Pivot Tables....................................................... 16 SESSION 6 – What If Analysis and Security......................................18 SESSION 7 – Working with the Internet, Other Applications and Workgroups.......21 SESSION 8 – Forms and Macros................................................... 25

Upload: others

Post on 10-May-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

MICROSOFT EXCEL KNOWLEDGE

Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method. United States: Smart Method.

Exercises have been done in Excel 2016.

ContentsSESSION 1 – Tables, Ranges, and Databases.........................................................................................................................2

SESSION 2 – Data Integrity, Subtotals and Validations..........................................................................................................5

SESSION 3 – Advanced Functions..........................................................................................................................................8

SESSION 4 – Using Names and the Formula Auditing Tools................................................................................................13

SESSION 5 – Pivot Tables.....................................................................................................................................................16

SESSION 6 – What If Analysis and Security..........................................................................................................................18

SESSION 7 – Working with the Internet, Other Applications and Workgroups...................................................................21

SESSION 8 – Forms and Macros...........................................................................................................................................25

Page 2: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

SESSION 1 – Tables, Ranges, and DatabasesExercise:

Use Land Speed Records file

Convert the range into a table and name it SpeedRecord

Use a simple filter to only show speed records achieved at Bonneville Salt Flats

Page 3: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Use an advanced filter to show speed records: At Bonneville Salt Flats that are greater than 575 mph Together with all records held by Tom Green

Sort the table A-Z, first by Location and then by Driver

Add a total row to the table and use the MAX function in column F

Page 4: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Use a formula containing a structure reference to show speeds in Km/h in column G

Notes:

Filters are case insensitive by default.

You can use the unique records only feature to extract all unique values from the list (find spelling errors).

It is crucial that you leave at least one blank row between the criteria range and any other range on the worksheet.

Criteria for filters can appear anywhere on the worksheet or even on a different worksheet and does not have to be complete. In this example, all of the fields in the range are listed b making a compete duplicate of the range headers. The advanced filter will work just as well if the header list is not complete. For example, to filter down the “Bonneville

Page 5: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Salt Flats” Location you could simply type Location into cell J1 and Bonneville Salt Flats into cell J2 and then set the criteria to J1:J2.

It is possible to extract records to another worksheet. Display the Advanced Filter dialog from the destination (and not the source) worksheet.

Sort a range by columns by adding a dummy row and numbering the columns. Sort the range by reference to row 1 by unchecking the My data has headers box, remove any existing sort conditions by the Delete Level button, Sort left to right, and Add Level to set a new sort on Row 1. Delete row 1.

The subtotal function can be used to ignore or show hidden rows. The total row ignores any rows hidden by default meaning that the function used to total the column is: =SUBTOTAL(109,[Value]). If you wanted to include any hidden rows in the total you would have to change the formula to: =SUBTOTAL(9,[Value]).

Converting ranges and tables has one simple rule: Apply the None style before converting table to range

There is never a good argument for abbreviating table names.

If you change a table name or a column name, any formulas that reference the table will automatically change. Unfortunately, this will not be case if you have macros that reference table names.

Formulas Formula Auditing Show Formulas to view the formulas in each cell.

SESSION 2 – Data Integrity, Subtotals and ValidationsExercise:

Open Sales Performance Analysis-1

Break the data in the Salesman column into two columns: First Name and Last Name

Page 6: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Automatically subtotal by Country showing subtotals for Salary and Sales

Add a validation to column C so that only England, France or Germany are valid

Page 7: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Add an Error Alert to column C

Add an input message to column C to inform users which countries are valid

Page 8: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Notes:

Golden Rule: Keep data atomic. A column should contain the smallest possible amount of data.

Totaling data from multiple worksheets onto a summary sheet is very common. Excel can automatically consolidate data if each worksheet has an identical structure, so it is a good idea to use templates. Create links to source data on the summary worksheet so that if a value on a source worksheet changes, the summary worksheet automatically updates.

You must convert the table into a range because you cannot add subtotals to tables (meaning automatic subtotals don’t work with tables). Another issue with automatic subtotals is that you have little control over the formatting of the subtotal data. Data consolidation can overcome both problems. Unfortunately, consolidated subtotals cannot be linked to source data.

When tables contain duplicate entries, they are said to be corrupt. Use a custom validation to add a unique constraint. Excel doesn’t provide an easy way to apply unique constraints directly. Use the COUNTIF function. This function returns the number of cells in a range that meet some specific criteria. So if the formula looks like =COUNTIF(A:A,A2)=1 that breaks down as: A:A means all of the cells in column A are defined as the range, the relative reference A2 is the criteria, and if the entry is unique the COUNTIF function will return a value of 1. As 1=1 is TRUE, the function returns TRUE.

Copy and pasted entries are not validated.

SESSION 3 – Advanced FunctionsExercise:

Open Employee Summary-1 from samples folder

Page 9: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Using the RIGHT, LEFT, LEN and FIND functions, split the Full Name in column A into Last Name and First Name

Use an exact VLOOKUP to return the Department for each employee1. Convert Departments range to table called Department2. VLOOKUP dialog

Page 10: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Use a COUNTIF function to return the headcount for each department in cells B20:B22

Page 11: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Use the YEAR function to populate column F with the year each employee started: “=YEAR(E4)” Each employee in the Sales department receives a 10% bonus while all other employees receive a 5% bonus.

Use an IF function to populate column G with the correct bonus percentage.

Page 12: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Notes:

DATEDIF is able to calculate the difference between two dates for several intervals.

Possible to use date offsets to manage projects using the scheduling equation but Microsoft Project is designed specifically to produce Gantt charts (shows inter-task dependencies) and manage projects.

24-hour notation is the best way to enter times as it is the least error prone and easiest to read.

Time calculations that span midnight can be solved by using IF logic. For example, IF(C8>B8, C8-B8, C8+1-B8). The formula works by adding he number one (representing one day) to the finish time when the finish time is less than the start time.

Best way to sum time serial numbers that exceed 24 hours: =SUM(D8:D12)*24 (format cell to a number). The advantage is that it is often easier to work with numerical values if you need to perform further calculations.

The default in Excel is the automatic calculation mode. Whenever a cell value is changed, all values that reference that cell are automatically recalculated. Its possible to change the mode to manual. This saves time is the worksheet is large.

Use the concatenation operator (&) to combine atomic data. Double quotation marks indicate that each value is a string. To add spaces between each of the strings, add a string containing only a space between each word. So, a formula could like: =A8 & “ (“ & B8 & “) - &” & D8. What if D8 is a number? The TEXT function allows numbers to be explicitly formatted as strings. The hash symbol (#) is mainly used to add comma separators. So, the formula could change to =A8 & “ (“ & B8 & “) - &” & TEXT(D8,”$#,#0”). This format string means show a leading dollar sign, show a comma after thousands, and show only whole numbers (no decimal places).

You will often need to extract data dynamically using a formula. Use LEFT, RIGHT, and MID functions. (Allow for formatting characters. A cell may be formatted to currency, so you would see $28.00 but the cell value is only 28.) You may want the results to be numeric values. To convert textual return vales to a true number, simply multiply the result of the formula by 1. So, the formula would look like: = LEFT(E4,3)*1

Avoid leading and trailing spaces with the TRIM function. Trailing spaces cause many problems when comparing data because strings that appear to be the same visually are, in fact different. =”+44 “ = “+44” returns FALSE=”+44” = “+44” returns TRUESo, using the TRIM function looks like =TRIM(LEFT(B4,C4-1))The VLOOKUP function retrieves data from a specific column in a table. Syntax: =VLOOKUP (Lookup_value, Table_array, Col_index_num, [Range_lookup]). Lookup_value is the value to be searched for in Column A. Lookup values must appear in the first column of the table, with lookup columns to the right. Table_array is the range, table, or name we will search for a match to the Lookup_value. Easiest to use a table name. Counting from left to right, the Col_index_num is the column that contains the value we want returned.

If the Range_lookup is left blank (defaulted to TRUE), VLOOKUP will return an inexact match. For VLOOKUP to work with inexact matches, it is vital that the lookup column is sorted in ascending order. Inexact matches are useful if you want a returned value that is within a range of values like a grading scale. If searching for an exact match set the Range_lookup to FALSE. If there isn’t an exact match, you’ll get an error message. To suppress error messages, use an IFERROR function. Wrap each VLOOKUP function with an IFERROR function to return a blank space when an error is encountered. So, the function looks like: =IFERROR(VLOOKUP(A6,Stock,2,FALSE), “”)

Page 13: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

SESSION 4 – Using Names and the Formula Auditing ToolsExercise:

Open Excel Quiz-1 from your sample folder

Select cells A5:E9 on the Choices worksheet Create range names from the selected cells using the value in the left column to name each range

Apply a list validation to cell C4 on the Quiz worksheet that will show a list of all valid answers to the first question

Page 14: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Copy and paste the validation from cell C4 to cells C5:C8

Put an IF function into cell E4 that will show the text “CORRECT” if the answer in cell C4 equals the correct answer

Hide columns A & D

Page 15: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Notes:

A Name can be applied to a range of ells, a single cell, a formula, a constant, or a table. Makes formulas more readable.

Range names cannot contain spaces & are not case sensitive. Remember not to abbreviate to possible row headers. ‘BOE’

Excel will choose range names automatically from the values in Top Row, Left Column, Bottom Row, Right Column when using Create Names from Selection; possible to create range names in two dimensions

Manual method: Define Name

You should use single-cell range names when a value may possibly change in the future. Constants are used for values that will rarely change. Named constants are useful because they are less likely to be change accidently. When you crate a named constant, there is no cell in the worksheet that contains the constant value.

Name Manager lists all currently defined names and allows editing. <F3> shortcut

*Without the use of range names, it wouldn’t be possible to copy and paste formulas between worksheets.

The INDIRECT function is useful when you want to convert a text value into a valid cell reference. Reference won’t change if row or columns are inserted in the worksheet.

Tables are a better way to implement a dynamic name.

Unfortunately, Excel doesn’t accept a table name for a list validation. It does accept a range name associated with a table. For example, you want to validate a list of offices. Worksheet has an Employees and a Validations tab. Create tables (‘Office’ and ‘Department’) in the Validations tab of the Offices and Departments rows. In the Employees tab Define Name to selected cells of the Office row and name ‘OfficeTable’. Note that the Refers box now contains: =Office[Offices] In Data Validation select OfficeTable from list of range names.

Suspected error: green triangle upper left-hand corner of cell

6 specific error values for formulas (not including #N/A):#NUM! usually caused by a formula that returns a number that is too large/small or a non-numeric value entered as argument for a function that expects a numeric value#DIV/0! Excel can’t divide by 0 (use IFERROR function to suppress error message)#NAME? most likely cause is you’ve used a range name that doesn’t exist#VALUE! Function contains an invalid argument#REF! formula refers to a cell that isn’t valid. This happens when you reference a cell from a formula and then delete the row or column that used to contain the referenced cell.#NULL! Usually means that you’ve incorrectly typed one of the arguments

Manual error checking: Options Formulas Enable background error checkingFormulas Formula Auditing Error Checking and/or Show FormulasFormulas Formula Auditing Trace Precedents (work backwards) Formulas Formula Auditing Trace Dependents (cells have formulas that directly reference chosen cell – click again and next level of dependents shown (icon in dependent cell indicates there is a dependent value in a different

Page 16: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

worksheet or workbook) – Double-click the dotted line to show source of value

Set up a watch window to monitor values in result cells (Watch Window).

Possible to have Excel read to you using Speak Cells. Easy option to double check entries.

SESSION 5 – Pivot TablesExercise:

Create a pivot table from the Data table with Carrier, Qty, and Total columns selected:

Add Row Labels and Values & Re-format the values in the pivot table

Add a calculated field to calculate the average cost per unit for each carrier formatted to two decimal places

Page 17: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Embed a second pivot table that will display sales by studio

Notes:

Pivot tables work well with worksheets that contain columns with repeating data

You can create a Pivot Table that is associated with a Range, a Named Range, or a Table

Fatal flaw of named ranges is that they only expand and contract when rows are inserted or deleted and NOT when data is added to the end of the range. Work-around is in lesson 4-6 using the OFFSET function. Or use a Table.

Understand how pivot tables can be used with an Access database:

(A relational database (Access) contains several tables joined together by relationships with more sophisticated validations. In this respect, Excel is a little like a simple “one table database.”)

Possible to use data directly (without first importing it) by selecting Use an external data source option in the Create PivotTable dialog box. A pivot table doesn’t automatically update when the data source changes. To update: PivotTable Tools Analyze Data Refresh (By default, Excel invisibly stores a local copy meaning you can still use the pivot table even if the source database is down.)

Filters are not inherited from source data. If you need the same filter in the pivot table, you must first create the pivot table and then apply the same filter. You can copy the filtered data to a new worksheet and create the pivot table from the subset of actual data.

Different pivot table report layouts – Compact form saves spaceOutline form more readable as each field has its own column labelTabular form is like a regular Excel table with totals shown at column bottom

Grand Total: right-click anywhere in pivot table, PivotTable Options, Totals & Filters tab

Add a calculated field to pivot table: source name must be different than label

Page 18: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Beware: when adding a calculated item, the calculated item corrupts the Grand Total. Solution: Group

When you group by months, be very careful that you also group by years. If you don’t, you’ll get Oct 2007, Oct 2008, etc. grouped into a single total.

Possible to group into different numerical bands.

Create a pivot chart from a pivot table.

SESSION 6 – What If Analysis and SecurityExercise:

Open Selling Price Calculator. Create an attractively formatted single input data table in cells D3:F18 to display Gross Profit and Gross Profit Percent that would result from a Retail Price of $24.95 in increments of 50 cents.

Use Goal Seek to calculate the Retail Price that would be needed to produce exactly 50% Gross Profit

Page 19: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Use the scenario manager to create three scenarios. Create a Scenario Summary report showing Sales, Total Cost, Gross Profit & Gross Profit Percent for each scenario.

Protect the worksheet so that only cells B4:B7 (the cells shaded yellow) can be changed.

Page 20: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Notes:

A simple data table calculates result values from input values. Single-input data tables can have the input cell along rows or columns. It’s also possible to place the result cells along the left of the data table and the input cells along the top (two-input data table). The canton (top, left corner

of table) can be hidden by Format Cells and in Custom typing ‘;;;’.

If you look at the function behind each cell in the data table, you’ll see: {=TABLE(,B7)} but there is no way to manually create a TABLE function. This is simply Excel’s “behind the scenes” way of implementing a data table. Data tables are read only. You cannot change or delete a cell in a data table. If you need to remove a cell in a data table, you must delete the entire table.

When you create a data table, you should always put the lowest input value into the source table. (And convert formulas into values (Paste Special as values).)

Scenario Manager allows you to compare different scenarios side-by-side. It is expected to have defined range names for input and result cells to display scenario summary reports. Without defined named ranges the report would show cell references rather than descriptive names.

(Able to display a drop-down list of defined scenarios from the Quick Access Toolbar. Right-click on toolbar, click customize, select Commands Not in the Ribbon, select Scenario, Add) The scenario manager can only handle 32 changing cells (v2007).

The Scenario Manager uses the term Changing cells to refer to Input Cells. Results from Scenario Manager are shown in the result cells with the dialog box still open. A Scenario Summary Report (or pivot table) shows side-by-side scenarios.

Excel allows you to merge scenarios from one or more other workbooks. Available in dialog box.

By using Goal Seek, Excel will change one (and only one) input cell so that the desired value is shown in one result cell.

Conceptionally, Solver is similar to Goal Seek, however Solver can change any number of input cells. (More advanced uses of Solver at www.solver.com) Install Solver add-on by Options Add-ins Solver Add-In (exercise in separate document)

If you are continuously hiding and unhiding the same rows and columns, you have an ideal candidate for a custom view. (Custom view doesn’t work if there is a table anywhere in the workbook. You can work around this limitation by using range names in place of tables.)

Because data is sensitive, you may decide to hide the entire worksheet. Right-click worksheet tab and click Hide. But anybody can then go and click Unhide. You can prevent unauthorized users from opening or modifying workbooks.

Page 21: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Protect the workbook with a password: In Save As dialog click Tools General Options

The Always Create Backup provides an escape route. A copy of the old workbook is saved every time you save, so that you always have two copies of each workbook. One copy has the file extension .xlk. The user is presented with a dialog box suggesting that the book be opened read-only when opening a protected workbook when the Read-only recommended is checked. If the user ignores this suggestion, a read/write copy will be opened. This copy cannot be used to overwrite the protected file but can be used to crate a new file with a different name.

Protecting the Structure: prevent user from inserting, deleting, renaming, moving, or hiding/unhiding any worksheet elements. Protecting the Windows: prevent users from re-sizing the worksheet windows

Restrict cells users are allowed to change: unlock cells (Format cells) and then protect worksheet (Review tab)

Allow different levels of access to a worksheet with multiple passwords. (You can allow access based upon Windows log-in password or user group. Review Protect Allow Edit Ranges

Digitally sign workbooks to confirm identity of the author and warn recipients if it has been changed since signature.

SESSION 7 – Working with the Internet, Other Applications and WorkgroupsExercise:

Open Spectrum Car Sales from sample folder Hyperlink the What is your budget? (Cells F7, F8, F9 and F10) to relevant worksheets. (Hyperlink shown in blue)

Hyperlink the Car of the Week BMW 3 Series text (cell D11) to the range B7:F7 on the Under £1,000 worksheet & Hyperlink the Just arrived Lamborghini Gallardo text (cell H11) to the range B9:F9 on the Over £5,000 worksheet

Page 22: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Make the email [email protected] text in cell D13 into an email hyperlink with the subject: Car sales enquiry

Publish the entire workbook as a single file web page (MHTML file) and view changed.

Page 23: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Open Stock List from sample folder

Place a linked object after the text in the Stock List word document that will show the contents of the Over £5,000 worksheet in the Spectrum Car Sales workbook.

Page 24: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Notes:

Hyperlink to worksheets within document: Select cell to be linked, right-click, Link, in dialog select Place in this Document

Hyperlink a range: select cells, Defined Name, Create from Selection, right-click, Link …

You need to use a special technique when you hyperlink to a range in a different workbook. Select cell to be linked, right-click, Link, in dialog select Existing File or Website, select file, click bookmarks, type in the cell reference (A74). It’s easy to expand it to a range if required (A74:A78).

It’s possible to include a screen tip for the hyperlink. It is better to define custom screen tips rather than the default.

To embed an Excel file into Word: Open worksheet you would like to embed in Excel In Word: Insert tab Text Object Select from File tab Browse for file check the Link to File

Possible to save Excel file as a single page and multiple page website. Save As select web page from drop down (MHTML) To create a “real” web site that can be accessed on the world wide web, you need to save to a web server

Excel allows you to create a web query that refers to a specific table on a specific web page. When a web query has been created, it’s possible to update the information at any time. You can even set a timed automatic update so that the

Page 25: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

information is always current. Execute a web query: Data Get & Transform Data From Web (see separate document for more detailed explanation).

Understand the different ways to share a document (Extensive notes taken in separate document).

Change History: (This explains tracking changes using Shared Workbook. Co-authoring doesn’t provide the ability to track changes, but if the file is stored on the cloud, it’s possible to view past versions so you can see each person’s changes.)

Change history is useful for two reasons:

1. It allows you to review changes made by other users and reverse them if needed2. It provides an audit trail that can be automatically added to a History tab (History file can get very large. You are

able to turn it on/off and change maintenance period in the Advanced tab of Share Workbook.)

Accept and reject changes to shared workbook: (Like the Shared Workbook feature, the Track Changes feature has also been hidden. Place features on Review ribbon under Excel Options.) Dialog has 3 options with their own sub-options:

1. When: (not yet reviewed, since date)2. Who: (Everyone, Everyone but Me, Me)3. Where: (allows you to view changes on a selected range)

The you are presented with details (user and time) of each edit.

You can mark each revision by selected a highlight color for the affected cells.

SESSION 8 – Forms and MacrosExercise:

Open Gala Dinner from sample folder Add combo box, group box, option button and check box form controls

Page 26: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Add a new worksheet named Data and add a named range named Tickets contain the numbers 1-10

Set the Input range of he combo box control to the Tickets range name

Link the combo box and check box controls to the input cells B19:B21

Add formulas to the result cells B24:B27 to calculate the total cost of the order

Add a formula to cell B13 so that it displays the same value as cell B27

Record a macro named PrintOrder in This Worksheet that will print cells A1:B13 Add a button control to the form that will run the PrintOrder macro

Page 27: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Notes:

Because form controls are an advanced feature of Excel, the Developer tab is hidden as a default. Within Customize Ribbon, under Main Tabs within the left-hand drop-down, Add the Developer tab.

Form Controls are designed to be used without any understanding of the Visual Basic for Applications programming language. ActiveX Controls are intended to be used as part of the VBA programming environment.

Developer Controls Insert Form Controls Group box, Option box, Combo box, Check box

Option box: to change text: right-click, press Esc, double-click in side box, delete. It’s important to create option buttons in corresponding order. If not, the wrong calculations will be done. (The value in calculations is shown as the number representing which option was selected not the actual value. For example, if the options are between 5% and 10% and 5% is chosen, the calculations will show the number 1 as the first option was chosen. If 10% is chosen, the calculations will show the number 2 rather than the actual 10% being calculated.)

Combo box: create a new worksheet to list options within combo box and create range name. Set the comb box’s Input Range to reference the range name within the combo box’s Format Control (right-click item to find). Like the Option box, it’s important to list options in order as calculations will show a number representing which option was selected.

Check box: when the box is checked, TRUE appears in corresponding input cell. When the box is unchecked, FALSE appears. When using check box data in result cells, the IF functions is also used.

When working with forms, it’s useful to separate the user interface from the calculations (input and result cells). Link cells in the user interface with corresponding input/result cells in the Cell Link box in Format Control.

Possible to add a single input data table to a form but be careful not to refer to the column input cell when creating data table column formulas. If you refer to the same cell as the Column Input Cell in a column formula, Excel will become confused. So, if you were to refer to cell D27 the data table would show some results correctly and other result incorrectly. There are work arounds such as entering the formula of a referenced cell instead of just the referenced cell.

Possible to protect the form so that users cannot alter the functionality or layout.

Understand macros and VBA

When using macros, Excel writes VBA code, but you don’t need to know anything about VBA to record a macro.

Page 28: SESSION 1 – Tables, Ranges, and Databases · Web viewMICROSOFT EXCEL KNOWLEDGE Source: Smart, M. (2010). Learn Excel 2007 expert skills with the Smart Method.United States: Smart

Macros are useful if you must complete the same inputs/functions regularly. Or re-arranging cell rows/columns. Or when switching between custom views.

View Macros Macros Record Macro (Name and Locate new function *Macro names cannot have a space)

Normally you’ll simply want to choose between This Workbook (when the macro is only useful in one workbook) and the Personal Macro Workbook (when the macro may be used by all workbooks).

Macros stored in This Workbook are also available to other workbooks but only if the workbook containing the macro is open. If you save the macro in Personal Macro Workbook every workbook has access to its macros. If you share workbooks with macros stored in Personal Macro Workbook, it will not work on the recipient’s machine.

Excel provides a shortcut to the macro. If you were to define <Ctrl>+<c> as your macro shortcut key, you would override Excel’s default shortcut key to copy.

It is good practice to describe your macros so that others may understand what its used for.

After clicking OK, you are now recording your macro. The macro will record every key press and every mouse click. There is no time limit so take your time to do things correctly.

When you press <Ctrl>+<Enter> you save the value into the cell without moving to the next.

When recording a relative reference macro, its vital that you select the active cell before beginning the recording.

Stop recording by either Macros Stop Recording or clicking on the Stop button on the bottom left of the status bar

To run a macro: Macros View Macros

Use shapes to run macros: save macros as before then Insert Illustrations Shapes, draw the shape, right-click to Edit Text, right-click after labelling to Assign Macro, select saved macro, OK.

If you have general-purpose macros (saved in the Personal Macro Workbook) that you would like to run with a single click you can add them to the Quick Access Toolbar. File Options Customize Ribbon (in Popular Commands)

Save as a macro enabled workbook. (.xlsx file extension for workbook .xlsm file extension for enabled workbook)

Its possible to send a virus (Melissa virus) through macros so only use macros from a trusted source.

Three mechanisms for recognizing a trusted workbook: place the workbook in a trusted folder, digitally sign the macro, warn the user before running a macro.

Add a digital signature to a workbook: To create a digital signature, you must have a signing certificate, which proves identity. When you send a digitally-signed macro or document, you also send your certificate and public key. Third party service providers on Office marketplace offer levels of digital signature assurance. File Info Protect Workbook

With macro-enabled workbooks one of three things will happen when opened: macros are enabled and there are no warnings, workbook opens without warnings, but macros are disabled, or Excel displays a security warning (default setting) Set the security options by clicking File Options Trust Center