Professional Documents
Culture Documents
Assignment 3 - Election Data Contd.: Steps
Assignment 3 - Election Data Contd.: Steps
03914788818)
Date: 20/03/2021 BCOM 4A
STEPS:
1. Open the excel sheet that has the data. First, we need to categorize the data. For that,
we use the if() function. Since we do not have the option to input multiple ifs in one go,
we need to do it in the following way:
=IF(Data1!E2<"21-30","Young",IF(AND(E2>="21-30",E2>="31-40",E2<="41-
50"),"Middle Age","Seniors"))
2. Next, to count the number of voters that have age greater than 50, we simply used the
countif() function, and selected our data as follows:
=COUNTIF(E2:E100,”>41-50”)
BCOM 212 – Financial Modelling Lab Yash Jain (Roll no. 03914788818)
Date: 20/03/2021 BCOM 4A
3. Now, to use the pivot tables, we need to first, select the data, and then go to Insert -----
--->Pivot Tables.
BCOM 212 – Financial Modelling Lab Yash Jain (Roll no. 03914788818)
Date: 20/03/2021 BCOM 4A
4. Now, after clicking on the pivot table, the following dialog box will appear –
5. Click on Ok, and the pivot table would appear. Now, it is time to select the fields for
the pivot table.
6. Now, select Party, and drag it onto the Rows part of the Pivot Table Fields. After that,
select Voter Id and move it to the Values part of the Pivot table fields. Now, click the
drop down box in the Voter Id selection under Values, and go to Value field settings,
where we would select ‘Count’, instead of ‘Sum.
BCOM 212 – Financial Modelling Lab Yash Jain (Roll no. 03914788818)
Date: 20/03/2021 BCOM 4A
With this, our Pivot table is created. Now, we can see the maximum number of voters are for
Democrat Party.
7. Now, we can filter the table, and select Republican and Democrat to know how many
voters were from which party. This is done as below:
BCOM 212 – Financial Modelling Lab Yash Jain (Roll no. 03914788818)
Date: 20/03/2021 BCOM 4A
8. Now, we will use a similar method to see how many voters declined to vote. For that,
in the filters column, we would select just ‘Declined’, and the results would be out. This
is done in the following way –
9. After this, the table would look like the one below:
BCOM 212 – Financial Modelling Lab Yash Jain (Roll no. 03914788818)
Date: 20/03/2021 BCOM 4A