Escolar Documentos
Profissional Documentos
Cultura Documentos
Solutions for week 1 of EX101x: Data analysis to the MAX()
Section 1.3: Strings
Questions
1. WHAT IS THE DATA YOU HAVE?
How many columns does the imported data have?
The data you imported should have had 5 columns: Symbol, Name, Last Trade, Change, and
Volume
What is the name of the second column?
The name of the second column is “Name”
Note: Both of these answers can be verified by using the spreadsheet provided by us for
those having trouble with importing.
2. THE FIND FUNCTION
What should be the first argument of the FIND function in this column?
The first argument of the FIND function was “ “, which finds the space in the text in the
Change column.
3. THE LEFT FUNCTION
What is the first argument for the LEFT function in row 8?
The first argument of the LEFT function in row 8 was D8, which indicates which text to be
taking the left side of.
4. THE TREND FORMULA
Please assemble the right formula for the 2nd row by dragging the pieces of the formula to the
correct place.
This question was drag and drop, the solution was the formula shown here:
In the exercises in this section, you had to create a new column in the stocks data called
Trend. The expected result is show below.
Section 1.5: Conditionals
Questions
1. FIND THE PROBLEM
Something is wrong with the spreadsheet that Felienne currently has, do you know what?
The problem with the spreadsheet was that the profit column calculation is based on wrong
information
. The calculation was multiplying the value of the shares times the total number of
shares owned, rather than the number of shares meant to be sold. Please see lecture 1.5 at
time 2:45 for the explanation.
Section 1.7: Bonus Exercise
FormulaBased Approach
First, we will describe what we found to be the optimal formulabased approach. The knacks
to this solution the task are to:
1. use the position information of special characters (such as commas)
2. use the prescribed length of part of an address (i.e., 2 characters for US state and 5
digits for postal code).
To be specific, we can extract the street (e.g., “911 FORRESTAL DR” in Cell B1) by applying
LEFT( ) function:
Similarly, the postal code (e.g., “76010” in Cell E1) can be extracted by applying RIGHT( )
function:
What about the 2character US state (e.g., “TX” in Cell D1)? We can first get the substring
“TX 76010” from the whole address and then extract the 2 staterelated characters:
To extract city, we can make use of the length of the extracted information (i.e., street, state
and postal code), which is computed by applying LEN( ) function. The whole formula is given
below:
Using Excel’s Builtin Tools
Several of our brilliant students came up with a solution without applying any functions!
Instead, they used the “Text to Columns” button in the Data ribbon, as shown below.
As we want to separate the address by commas, we need to select “Comma” and press Next
to then get the preview as follows:
To separate state and postal code in the last column, we only need to repeat the above
procedure, but choosing “Space” for Delimiters. However, as some postal codes start with “0”,
we also need to choose Column data format as “Text” when separating the data, shown as
follows.