Homework 5: Things are Looking Up even More.
The goals of this homework are:
- Apply Index and Match to find values.
- Test results.
Download this data
- I would like you to practice index/match, not vlookup. Some of these tasks might be a bit silly, but please do them.
- In addition, I would like to format this data so it could easily be saved into a database.
- To do this, we will decompose the data into a series of tables.
The general plan is to break the data down into the following tables
- Crime : a table of all of the data, but with the following as indexes
- Motivation: the unique motivation types
- Statue : the unique statutes
- Gender : the unique genders
- Race : the unique races
- Religion : the unique religions
- Type : the unique victim types
In addition, we will build a worksheet to double check our results.
This is probably not something you would normally do, decompose a table into final parts, but I feel the exercise is good. It will give you practice with the functions AND will help you understand what a dba wants.
Please do the following:
- [10%] Enter your name in the About worksheet, maintain this worksheet
- Remove the formatting from the raw data table.
- Select the entire table.
- On the Home tab, Editing workgroup select the
Clear button
-
- Select item number 2 on the drop down menu Clear Formats
- [10%]Build a Gender table
- Start a new worksheet called Gender
- Extract the unique values for the gender for both column D and column I
- You may do this with the advanced filter function on the data tab
- Or use the function on page 441 of the book.
- Add Headers
- Sort Alphabetically
- In the end, the worksheet should contain
-
- [30 %] Repeat this for
- Motivation
- (Column A)
- Sort alphabetically
- Add headers
-
- Statute
- column B
- Sort alphabetically
- Add headers
-
- Race
- Extract both columns E and J
- Combine and remove duplicates
- Sort Alphabetically
- Add headers
-
- Religion
- Extract both columns F and K
- Combine and remove duplicates
- Sort Alphabetically
- Add headers
-
- Type
- column G
- Sort alphabetically
- Add headers
-
- You will probably want to name all these columns for later use.
- Make a copy of the RawData worksheet
- Name this Crimes
- Replace Column A, Motivation with the Motivation ID
- Insert a column
- Name it Motivation Key
- Lookup the ID based on the motivation, look up the appropriate motivation id.
-
- Add a column to perform a lookup of the motivation based on the new Motivation Key
- Add a column to test to see if the Motivation and the Check column are the same
-
- Off to the right (column O right now)
- Add a table, that checks to see if the check column is all true.
-
- Repeat this for the other tables.
- In the end, I ended up building a test table based on the column letter of the check
- Make a Crimes table worksheet.
- Hide all but the valid data columns.
- Select the table
- Go to the Home tab in the Editing workgroup select Find & Select
- Pick Go To Special
- On the left hand side select Visible cells only, ok
- Copy the data
- Insert a new worksheet called CrimeData
- Paste as values
- Save this workbook.
Submit
Upload the workbook to the D2L folder Homework 5 by 3/28/19