3. Table of Contents
Introduction 1
Step One—Setting Up the Initial Excel Worksheets 2
Step Two—Creating a Microsoft Query 5
Step Three—Creating Pivot Tables 11
Step Four—Creating a Report Table 15
Step Five—Updating the Report Table 18
Appendix—Using a Query at a Later Time 21
6. STEP ONE—SETTING UP THE INITIAL EXCEL WORKSHEETS
1) Open a blank Microsoft Excel workbook.
2) You will need three separate worksheets‐one for faculty information, another for course
information, and one with the course schedule.
3) Faculty worksheet—For the faculty worksheet you will need at least 3 fields (an identifier, the
faculty’s full‐time/part‐time status and their terminal degree status).
4) Course worksheet—The second worksheet contains information on individual courses in your
curriculum. The worksheet must have a course identifier field (If you use course numbers,
make sure the section numbers are not included) and fields for the programs for which the
course is associated.
2
7. 5) Course schedule worksheet—The third worksheet will contain the course schedule for a
particular semester. The worksheet must contain the course identifier field as found with the
course worksheet and the faculty identifier as found in the faculty worksheet. These fields will
be used to join all three worksheets together.
6) Once you have your data entered into your worksheets you will need to “name” your data.
Hi‐light the data in the worksheet (We always include additional blank lines below the data in
case we need to add instructors or courses). Go to the Formula Tab and click on Define Name.
3
8. 7) Name your data (Note: no spaces are allowed between words).
8) After you name the data in all three worksheets you can see your data in the Name Manager.
You can also edit the data range from the Name Manager dialog.
9) Your worksheets are now ready to be combined through Microsoft Query.
4
9. STEP T
TWO—CRE
EATING A M
MICROSOF
FT QUERY
1) O
Open a new w
worksheet w where you wwill create your combined
d data set an
nd name the
e worksheet
“D
Data”.
2) Choose Data,
, Get Extern
nal Data, Fro
om Other So ources
rom Microso
3) Fr oft Query
4) The first time
e you access a workbook
k database yyou’ll need to
o create a ne
ew Data Sou
urce. Under
th
he Database es tab choose
e <New Dataa Source>
5) Inn the first ed
dit box of the
e Create Neww Data Sour rce dialog, give your datta source a nname that
will remind yo
w ou to what it is connecte
ed. This is th
he name you u will select f
from a list w
when you
crreate new queries later. .
5
10.
6) Under “Select a driver for the type of database you want to access” choose Microsoft Excel
Drivers (*xls, *xlsx, *xlsm, *xlsb).
7) Click Connect.
8) Choose Excel 97‐2000. Even though we are using a later version of Excel, the most current
version of Excel listed is Excel 97‐2000.
9) Click Select Workbook.
10) Use this dialog to navigate to the workbook that will serve as your data source. Here,
Sample File 1a.xls contains my faculty and course information. Select the workbook from the
list.
11) Keep clicking OK until you return to the Choose Data Source dialog box.
6
11.
12) The Choose Data Source dialog box now contains the data source “Faculty Credentials”. Click
on “Faculty Credentials” and click OK. (Make sure the box next to the “Use the Query Wizard
to create/edit queries” is not checked.
13) Excel will display both the full‐screen Microsoft Query application window and the Add Tables
dialog box. You will use these tools to specify what data you want returned.
14) In the Add Tables box, double‐click on each of the tables you want to add. Once you have
chosen your tables you can close the dialog box.
7
12. 15) Once you have chosen your tables, you must join them using the common field names. Click on
the field name you want to join from the first to the second table and drag across to the second
table. Do the same thing to join tables 2 and 3.
16) Next we will add the fields we want in our report by dragging the fields into data window. The
data will appear below the tables window.
17) Save your Query at this point. Queries will be saved on the hard drive of the computer and can
be used again to update information.
18) To export the data to your blank worksheet click the Return Data button.
8
13. 19) Indicate that you would like to view the data in your workbook as a Table.
20) Your data from your three worksheets are now combined.
21) The next step in creating the Report Table is to create pivot tables for each of the academic
programs. Pivot tables will allow you to quickly see faculty credentials by program.
9
14. IMPORTANT POINTS IN USING MICROSOFT QUERY
1. The Microsoft Query must be saved to the hard‐drive on your computer in order to join the
Excel worksheets. Because it is saved to the hard‐drive it cannot be copied and used on
another machine without rewriting the query.
2. The workbook containing the Microsoft Query and the worksheets cannot be copied and
used under a different file name. The query is written for a specific file and will always
attempt to access the original file when pulling data. Our best advice is to keep one file that
possesses the query and once the worksheets are joined, save the joined worksheet as a
different file, but always use the original workbook for updating data.
3. It is important to always make sure that your faculty and course worksheets are updated
when new faculty or courses are added. The query will only join cases that have matching
data. For example, if a course in the course schedule worksheet is not represented in the
course worksheet, the case will not show up in the combined worksheet. We suggest
checking that the number of courses in the combined worksheet equals the number of
courses in the original course schedule worksheets.
10
16. 5) The data range will appear in the Create Pivot Table dialog box.
6) Click OK
7) The Pivot Table Windows will appear in the pivot tables worksheet
8) From the Pivot Table Field List (on the left) click on the Course field and drag to the Σ Values
window (bottom right widow).
12
17. 9) Next choose the Full‐Time field and place in the Column Labels window and place the
Business field in the Report Filter window. These fields will all us to see the number of
Business Courses that are taught by full‐time faculty.
10) In the pivot table click on the Business Field Filter and click yes and OK. This will pull only
courses that fulfill the requirements for the Business major.
13
18. 11) To create pivot tables for the Education major and the Core, copy and paste the Business pivot
table in spaces below the business table. Substitute these programs for Business program in
the Pivot Table Field List (remember to change the filters to yes).
12) To create pivot tables for the terminally‐degreed data, copy the three pivot tables you just
created, paste these below the existing tables and substitute terminal‐degree for full‐time in
the Pivot Table Field List. You should now have six pivot tables in your pivot tables worksheet.
14
19. STEP FOUR—CREATING A REPORT TABLE
1) To automatically update a table like the one below, you need to link the table to the pivot
tables you created in excel.
2) Create your table in your workbook by adding another worksheet. Write your formulas for
your percentages (note, once you complete the formulas for one “yes” and “no” pair, you can
copy and paste the formulas into the cells for the remaining pairs).
3) Once you create your table and the formulas for your percentages you will begin to link the
table to the pivot tables.
15
21. 7) The value will automatically appear in the summary table.
8) Continue the process for all the cells.
9) Your report table is now linked to the pivot tables. This will allow you to update the table when
you refresh the pivot tables.
17
22. STEP FIVE—UPDATING THE REPORT TABLE
1) Add or delete data in Course Schedule worksheet.
2) Go to the Data worksheet and click on a cell in the table.
3) Click on Data tab in the tool bar and click Refresh. The query will be automatically update the
data sheet.
4) Your combined data worksheet has now been updated to include the changes you made to the
schedule.
18
23. 5) Now you need to update the pivot tables. You can automatically update the pivot tables with
the click of one button.
6) Click on the Pivot Tables worksheet and click on a cell in one of the pivot tables. A Pivot Tables
Tool tab will appear in the tool bar. Click on Options.
7) Click the Refresh button. If you copied your pivot tables from the first pivot table, all the tables
should update with the click of the Refresh button.
19
24. 8) Return to your Report table worksheet. The changes should appear in the table.
BEFORE UPDATE
AFTER UPDATE
20
25. APPENDIX—US
SING A QUERY AT A L
LATER TIM
ME
1) O
Open new w
worksheet where you will create youur Excel repo
ort.
2) C
Choose Data
a, Get Exter
rnal Data, Fr
rom Other Sources
3) F
From Micros
soft Query
4) CClick the Queries tab and choose the query you want to use
e.
5) C
Click Open a
and Microsof
ft Query view
w will appea
ar.
21