Basic Tutorial To Use Pivot Table in Excel
Basic Tutorial To Use Pivot Table in Excel
In this tutorial, you’ll perform basic data analysis using an some data as shown in Figure 1. The full data can be
found in “beginner-DA-course-blank.xls”. Follow the step by step guide in this worksheet to do the following
tasks.
1. Quick statistics
2. Exploratory Data Analysis (EDA) with Conditional Formating (CF)
3. Sales by country (with formulas)
4. Sales by country (with pivots)
5. Are there any anomalies in the data?
6. Vlookup
When you open the “beginner-DA-course-blank.xls” file, you will be presented with data as shown in Figure 1
below. Scroll down to see the full data. Complete Task 1 to 6. Let’s get started.
Figure 1 Data
Create a new sheet and name it as 1 or Task1 if you like, naming is up to you.
Figure 2 Sheet 1
You will use simple formula to calculate basic statistics. Create a simple table as shown in Figure 3 to do the
quick statistics exercise.
Amount Units
Average $4,136 152.2
Median $3,437 124.5
Min $0 0
Max $16,184 525
First Q $1,652 54
Third Q $6,246 223.5
Enter the following formula to do quick statistics analysis for both Amounts and edit the formula accordingly
for Units to get the values displayed in Figure 3.
=AVERAGE(data[Amount])
=MEDIAN(data[Amount])
=MIN(data[Amount])
=MAX(data[Amount])
=PERCENTILE.EXC(data[Amount], 0.25)
=PERCENTILE.EXC(data[Amount], 0.75)
=UNIQUE(data[Product])
=COUNTA(UNIQUE(data[Product]))
1. Create a new Excel sheet in the same excel workbook for this task.
2. Then copy Data table and paste it in the new sheet (in the same workbook).
3. Then press ctrl+shift+down arrow for column Amount and then click on the Conditional Formatting
icon on the menu bar.
5. Then, select column Amount > Conditional formatting > Data bars
6. Click on Amount header and then choose sort largest to smallest
7. To clear previously applied conditional formatting, click on conditional formatting icon again and
choose the option “clear rules from this tables/selected cells”
8. select amount > conditional formating > top/bottom rules > above average > ok
9. select amount > conditional formating > Top/Bottom rules > top 10 items. Your final output should
look like Figure 6.
10. You can play around with the options available for both Data bars and Color Scales. You will end up
with something like Figure 6.
For task 3, you need to calculate sales by country using excel formula. First create a new sheet, named it as 3.
This is a quite useful and basic analysis with this kind of sales data. From that analysis you can figure out the
top performing sales by country.
1. First, you need to create a list of countries that are listed in column D. To do that, you can use
UNIQUE function if working on excel365 and you can do it manually if you are not using excel365.
2. To list unique countries manually, copy and paste all cells under Geography and paste in this sheet,
then remove duplicates (Data > remove duplicates).
3. Use SUMIFS formula as below in column J to get the sum of Amount for each of the country as in
Figure 7.
Figure 7
Figure 8
Figure 9
8. Make it more presentable using conditional formatting. Make a copy of the data, paste below it as
below. Repeat step 3-5 in task 2 to complete this step and get the following output. See below.
Figure 10
For this task, we are basically doing the same thing in Task 4, but we will use pivot table.
Figure 12
Figure 13
Figure 14
Figure 16
10. Go to Pivot menu > Right click on SalesPerson > Add a Slicer
Figure 17
11. If you manage to complete this step successfully, you should get a slicer displayed. See below.
Figure 18
It would be useful also to check for anomalies when you are presented with any data. These anomalies might be
due to human error during data entry or anything else that requires further investigation.
1. For this task, we will use the chart functions in excel to detect anomalies in the data by using Scatter
plot. First select the Amount and Unit column and apply scatter plot as below.
Figure 19
2. You can also use Box and Whisker Chart as below. Click Ctrl key and select both Geography and
Amount. Notice that both columns are highlighted. Then, click on Recommended Charts icon and
select Box & Whisker.
Figure 20
Figure 21
Figure 22