See code repo of this website!

Introduction to Data Analysis Using Microsoft Excel


Lab

Lab Instructions

1. Upload a document using the free online version of Microsoft Office 365

In this task, we will learn how to set up a Microsoft Office 365 account, upload a file to our drive, and open the file. We will also learn how to convert the data into a table to aid with the data analysis we will perform in the remaining tasks.
Using Online Microsoft Excel

Steps:

  1. Go to https://www.microsoft.com/en-us/microsoft-365/free-office-online-for-the-web.
  2. Sign up for a free account.
  3. After you have created an account, sign in.
  4. Click the 9-dot [App Launcher] button on the top left corner.
  5. Choose [OneDrive].
  6. Download the Excel file at https://github.com/dark-teal-coder/web-introduction-to-data-analysis-using-microsoft-excel/blob/main/docs/office_chair_sales_data_analysis.xlsx.
  7. Upload the Excel file to OneDrive.
  8. Click open the Excel file. See below.

  9. lab-task-01-office-chair-sales-data-analysis.png

Turning Data into Table

Steps:

  1. To highlight the table, select the cells A4 to L84.
  2. Click [Insert] and then, [Table].
  3. In the pop-up, check "My table has headers" and then, click [OK].

  4. lab-task-01-create-table.png
    lab-task-01-data-turned-into-table.png

2. Perform data analysis using sorting and filtering tools

In this task, we will start analyzing the data using sorting and filtering tools.
Sorting in Excel

Steps:

  1. To the right of "Sales Rep" column, click the drop-down arrow.
  2. Choose [Sort A to Z] to sort it in alphabetical order.

  3. lab-task-02-sort-a-to-z.png
  4. To the right of "Num" column, click the drop-down arrow.
  5. Choose [Sort Smallest to Largest] to go back to the original data.

Filtering in Excel and Calculating the Total Sales Made by North Division

Steps:

  1. To the right of the "Region" column, click the drop-down arrow.
  2. Uncheck "Select All".
  3. Check "North".
  4. Click [Apply].

  5. lab-task-02-filter-region.png
  6. Select all the cells in the "Total" column and see the sum at the bottom right corner (i.e. $179,065).

  7. lab-task-02-total-sales-north.png
  8. To the right of the "Region" column, click the drop-down arrow, check "Select All" and click [Apply] to go back to the original data.

Filtering in Excel and Calculating the Total Sales Made by and the Total Number of Items Sold by a Representative

Steps:

  1. To the right of the "Sales Rep" column, click the drop-down arrow.
  2. Uncheck "Select All".
  3. Check "David Garcia".
  4. Click [Apply].
  5. Select all the cells in the "Total" column and see the sum at the bottom right corner (i.e. $71,040).

  6. lab-task-02-total-sales-by-rep.png
  7. Select all the cells in the "Number" column and see the sum at the bottom right corner (i.e. 253).

  8. lab-task-02-total-items-by-rep.png
  9. To the right of the "Sales Rep" column, click the drop-down arrow, check "Select All" and click [Apply] to go back to the original data.

3. Perform data mining using the IF function

In this task, we will learn how to do some data mining using the IF function. The idea behind data mining is that we take the data that we already have, and we create new or additional data from it.
Using IF Function to Get Discount Prices

Steps:

  1. Create a new column with the header "Discount" to the right of the existing table.
  2. In the first cell in the new column (i.e. M5), type "=IF(J5>20, "Y", "N")" and press [ENTER].
  3. To make it easier to see, highlight the M column and click [Align] under the [Home] tab and [Center].
  4. Create a new column with the header "Final Price" to the right of the existing table.
  5. In the first cell in the new column (i.e. N5), type "=IF(J5>20, 0.95*L5, L5)" and press [ENTER].
  6. To format column N, click the drop-down arrow to the right of [Number Format] under the [Home] tab and choose [Currency].
  7. Click [Decrease Decimal] twice.

4. Create references between tables and search for information with VLOOKUP

In this task, we will learn how to relate tables located
Looking Up the Company Name from Customer ID

Steps:

  1. To the right of the "Customer ID" column, highlight column G and right-click.
  2. Choose [Insert Columns] or [Insert 1 Column Left].
  3. Rename the new column "Company Name".
  4. In the first cell in the new column (i.e. G5), type "=VLOOKUP(F5, 'Customer Info'!$A$4:$C$12, 2, FALSE)" and press [ENTER].
    1. For the first value in the VLOOKUP formula, select cell F5.
    2. For the second value in the VLOOKUP formula, click on the "Customer Info" worksheet.
    3. For the second value in the VLOOKUP formula, highlight cells A4 to C12.
    4. For the second value in the VLOOKUP formula, press [F4] to add "$" in front of the letters and the numbers for our reference cells to anchor these cells so that the range does not change when we apply this formula to the other cells for the other column.
    5. For the third value in the VLOOKUP formula, specify the column index number 2 from the reference table for the value we want to return (i.e. "Company Name").
    6. For the fourth value in the VLOOKUP formula, type "FALSE" for an exact match.
  5. Press [ENTER].

Looking Up the Representative from Customer ID

Steps:

  1. To the right of the "Company Name" column, highlight column H and right-click.
  2. Choose [Insert Columns] or [Insert 1 Column Left].
  3. Rename the new column "Representative".
  4. In the first cell in the new column (i.e. H5), type "=VLOOKUP(F5, 'Customer Info'!$A$4:$C$12, 3, FALSE)" and press [ENTER].
  5. Press [ENTER].

  6. lab-task-04-vlookup.png

5. Perform data analysis using PivotTables

In this task, we will learn about another strategy for data analysis which is using Pivot Tables. PivotTables allow us to summarize and analyze the data by seeing comparisons in our data.
Using PivotTables to Calculate Sales Made by Each Representative in Each Month

Steps:

  1. Highlight all cells in the table (i.e. A5 to P84) in the "Sales Data" worksheet.
  2. Click [PivotTable] under the [Insert] tab.
  3. Click [OK].
  4. In the [PivotTable Fields], drag "Final Price" to [Values] and "Sales Rep" to [Rows] or [Columns].
  5. In the [PivotTable Fields], drag "Sales Rep" to [Columns] and "Month" to [Rows].

  6. lab-task-05-pivot-table-1.png

Using PivotTables to Calculate How Many Chairs of Each Model Were Sold in Each Month

Steps:

  1. Clear the [PivotTable Fields]
  2. In the [PivotTable Fields], drag "Number" to [Values], "Model" to [Colums], and "Month" to [Rows].

  3. lab-task-05-pivot-table-2.png


Graded Assignment

Question 1

You are working in Excel through free Microsoft Office Online and have just finished inputting the sales data from your company. You wish to save the changes made on your spreadsheet. What steps should you follow?

Question 2

Sophie is working on sales data from her company and wishes to only see sales from March while hiding the sales from all other months of the year. What steps should she take?

Question 3

Sophie is working on payroll and has data on the weekly hours for each employee. She wishes to create a new column in her table to classify each employee as F for “Full time” if they worked 40 or more hours, or P for “Part-time” if they worked less than 40 hours.
What function would she write for the first cell (E3) of the column?
graded-assignment-q3.png

Question 4

Sophie is working on an order and wishes to calculate the total price for the order. She first needs to look up the prices for each item in the order, given the product name and price data.
What function would she write in cell E2 to obtain this information without doing it manually?
graded-assignment-q4.png

Question 5

Sophie is working on sales data from her company and wishes to see what the total profits were for each Region, on each month. What PivotTable would she draw?

Graded Assignment Answer Key

Question 1

Answer: None. All changes are automatically saved while working on Microsoft Excel.
Explanation: With the online version of Microsoft Excel, any changes made to the file are automatically saved.

Question 2

Answer: Convert her data into a table and filter the month column to only show the sales from March.
Explanation: You can filter data in Excel by first converting the data into a table and select the dropdown arrow next to the header to filter the data with respect to a given category.

Question 3

Answer: =IF(D3>=40,"F","P")
Explanation: The IF function allows us to determine new information from our data. The IF function must include the logical test which is D3>=40, the response if this is true which is "F" for Full-time, and the response if this is false which is "P" for Part-time.

Question 4

Answer: =VLOOKUP(D2,$A$2:$B$12,2,FALSE)
Explanation: The VLOOKUP function allows you to search for information relating data located in different tables and even worksheets.

Question 5

Answer: The PivotTable would have: Profits as Values, Region as Columns, and Months as Rows.
Explanation: In the PivotTable, the Profits must be in the Values category since they are the numerical component. Then, Region can be positioned as Columns while Months are positioned as Rows or vice versa.