0% found this document useful (0 votes)
36 views12 pages

Workshop 11 - Notes Student Version

1. The document provides instructions for several tasks involving analyzing world happiness data from 2015-2020 using Excel. 2. Tasks include downloading the data, creating a data dictionary, performing pivot tables and pivot charts to summarize the data by country and calculate metrics like sums, averages, minimums, and maximums for CPI and happiness scores. 3. Advanced tasks involve combining data from multiple tables after looking up and correcting values based on the year.

Uploaded by

jellyqueen3104
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views12 pages

Workshop 11 - Notes Student Version

1. The document provides instructions for several tasks involving analyzing world happiness data from 2015-2020 using Excel. 2. Tasks include downloading the data, creating a data dictionary, performing pivot tables and pivot charts to summarize the data by country and calculate metrics like sums, averages, minimums, and maximums for CPI and happiness scores. 3. Advanced tasks involve combining data from multiple tables after looking up and correcting values based on the year.

Uploaded by

jellyqueen3104
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Workshop 11 – Exercises

Task 1

1. Open data from this link https://www.kaggle.com/datasets/eliasturk/world-happiness-


based-on-cpi-20152020
2. Download the data
3. You will need to login with google first, so make sure you are logged onto your
University of Portsmouth email

You should see the data and it should look something like this:

You need to make sure that you save it as an excel file.

Task 2

1. What is the data about?


2. Where was the data from?

Task 3

1. Create a new tab


2. Create a data dictionary, making the table look nice (font/headings/wrap text)

We have discussed databases and how they need Primary &/or Foreign keys to join the text. We are
told that
Task 4 this data was taken from two sources.

1. What is the field that joined the data?


PivotTable
PivotTables are a quick way to summarise your data without using any formulas.

Here is an example:

This is the full data that we were working with a few weeks ago, but before we start we need to
make sure that all columns are named, and there are no duplicate rows or blank cells.

Fields

These are all called “field” the PivotTable function uses the word “field” a lot.

If we wanted to we could create a PivotTable with this data, and one of the simplest things to do is a
Sum. So if we wanted to know the total price of all the bikes we would do the following:
1. Click “Insert” from the ribbon
2. Click “PivotTable”

It should then come up with this:

Select the table range


Select the whole range
for the table

This is where the


PivotTable will be
placed. You can
change it to new
worksheet if it is
going to be large.

1. Select range
2. Check location
3. Click OK

This will bring up this table


Click and drag to Value

This will give us this table


We can divide it up by adding either columns or rows. So if we wanted to know Product and Sum
Price we would click the following:
Giving us this table
Task 5

1. Do a Pivot table for the world Happiness tab in a new tab


2. Include the Country in the Row
3. Include the CPI score and Happiness Score as a sum

You can play around with what excel calculates, so you do not have to just calculate the sum. You
can include the following:

 Sum
 Count
 Average
 Max
 Min
 Product
 Count Number
 Standard Deviation
 Standard Deviation of Population
 VAR (Variance)

This is how you would change it:


Click here and go to “value
field settings”
Change to a new type,
i.e. Average

Task 6

1. On your new tab, change the value of the CPI and Happiness Index to Max

You can add the same field in again and have a different number. So for example we could have the
Sum of £ Price and the Average £ Price by selecting the same figure twice. Like this:

It will look like this


Task 7

1. In your pivot table add the Min for both CPI and Happiness
2. Have a play around with what data you can get from this chart

In addition to doing PivotTables you can also do PivotCharts. Under <Insert> go to <Charts> and click
on <PivotChart> but remember to put your mouse on the PivotTable which you want to make into a
chart.

This should give you these options


From here you can select the type of chart you would like i.e. Cluster Column:

Task 8

1. Create a chart of your choosing to show your PivotTable results


This is an advanced task that will rely on what you a few weeks ago, if you do not have time to
complete it, please attempt it for home study.

Task 9

1. Open Task 9 excel file in moodle


2. You need to create the following new columns:
a. In the “WorldHappiness_Corruption_2015_” tab , insert a new column B , labelling it Country,
Continent and Year, in this column join the Country, Continent & Year with gaps in between
each word eg. Afghanistan Asia 2015
b. In the tab called “Task 9” – do the same as above in column D
c. If you can’t remember how to do this use this link:
https://support.microsoft.com/en-gb/office/combine-text-from-two-or-more-cells-into-one-
cell-81ba0946-ce78-42ed-b3c3-21340eb164a6

3. You need to find the CPI and Happiness Indices in columns E and F (hint: use a VLOOKUP to do this
for the first one, stick the range in the formula and copy down)

Use this link if you can’t remember how to do vlookups:


https://support.microsoft.com/en-au/office/video-vlookup-when-and-how-to-use-it-9a86157a-5542-
4148-a536-724823014785

4. You have been told that the Happiness Index was incorrect for 2015, so you need to add on 1 to all
observations from 2015 – use CPI corrected column. You can do this in one step but if you need to do
2 steps feel free to insert a working column (hint: Use If function).

Use this link if you can’t remember how to do IF functions


https://support.microsoft.com/en-gb/office/if-function-69aed7c9-4e8a-4755-a9bc-
aa8bbff73be2#:~:text=Syntax,another%20value%20if%20it's%20false.&text=For%20example
%3A,Budget%22%2C%22OK%22

Now do a PivotTable showing the average score for CPI and Happiness for each continent.
5. Which has the highest average score for each?

You might also like