Solving Data Problems-1 (1)
Solving Data Problems-1 (1)
Over time, you will build up a language to efficiently search and find solutions to your
problems. This takes practice. A lot of practice.
Please review the short article, Solving Data Problems: A beginner's Guide . Then, obtain
the DataPreparationChallenge_01 data file which contains three: name, DOB, and score.
Complete the following tasks after familiarizing yourself with the data.
Tasks
1. Use the column 'name', to create two new columns that containing each student's
first name and last name. Label these columns as firstName and lastName,
respectively.
2. From the date of birth (DOB) column, create two additional columns labeled
birthYear and birthDayOfWeek. For the birthYear, extract the year from the DOB
column. For the birthDayOfWeek, provide the full spelling of the actual day of the
week the person was born. Do not report a number or an abbreviation.
3. From the DOB column, create a variable currentAge, using January 1, 2022 as the
date for the calculation.
4. Each student has a score. Please assign a letterGrade as follows:
< 60 = F
61 - 70 = D
71 - 80 = C
81 - 90 = B
91 - 100 = A
5. Students are required to earn a C or better to receive course credit. Create a
variable called final. If the student earned a C or better, assign the student the
value pass, otherwise a D or F should be fail.
6. Create a new variable called section. Randomly assign students to one of seven
different groups (Section-1, Section-2, Section-3, Section-4, Section-5, Section-6,
or Section-7).
7. a. Create a unique ID for each person in the data file. The ID should be a
combination of the first two initials of the firstName, the full lastName, the last 2
digits of their birthYear, and a 3-digit random number. This ID should not
contain any spaces.
❝ Hint: Do not try to complete this task at once. Instead, break it down and
use a set of helper columns. For example, create a column of just the first initial.
Then, create a column of the 2 digits of the birth year. Then, create a column of
the 3-digit random number. Finally, paste them all together. The process of
breaking down problems is essential! Keep all the columns you have created to
get to your final step.
8. Create a column called email. Create an email address by combining the ID with
@DataWorkout.com.
9. Create a column called hyphenatedName. Write a function that identifies whether each
person's name contains a hyphen. If yes, then return TRUE, else return FALSE.
10. Create a column called firstNameLonger. Test whether each firstName contains more
characters than the corresponding lastName. If there are more characters in the
firstName, then return TRUE, else return FALSE.
11. Create a column called firstNameLetter and extract the first letter from each
person's first name. Then, using the VLOOKUP function, match that first letter to obtain
the Code-word from the Nato-phonetic-alphabet . For example, for the name Brian,
the first letter extracted is a B. The corresponding phonetic code word is Bravo.
12. Create another column called lastNameLetter. Obtain the phonetic code word just
like task number 11, but using the first letter of the last name.
❝ Hint: VLOOKUP is one of the most powerful functions in Excel! Take time to
understand how to properly set up the arguments and data.
Submission
Please upload your Google Sheet to the submission portal on CANVAS. Be sure to reach
out to the class on Slack to address questions you may have.