You are on page 1of 5

Summarization and Analyzing the data with Pivot Tables

M.N. Reddy, D.R.Rao, K.V. Kumar


National Academy of Agricultural Research Management, Hyderabad

The data given in Microsoft Excel Worksheet shows the Andhra Pradesh District wise data on
Rice Area, Production, Yield, Total Rice Area Irrigated, Nitrogen consumption per ha during
the period from 1970 to 2000. Calculate mean, Standard deviation, C.V. (%), Growth rates
for each parameter and depict them on Andhra Pradesh Map with appropriate formulas and
draw your inferences.

Procedure calculating mean, Standard deviation, C.V. (%), Growth rates for Rice Yield

Getting Data for Rice Yield

Analyzing Data with Pivot Tables

Excel provides many useful data analysis tools. One of the interesting, yet probably least used
and understood is the pivot table. A pivot table is a tool that provides a different way of
looking at your data. It provides a dynamic summary of data that it contained in a database.
Using this Pivot Table one can summarize the categorical data very easily and efficiently. In
this exercise you’ll learn to create a PivotTable report by using the PivotTable and PivotChart
Wizard.

What Types of Data You Can Use

Excel data list or database

External data source The external databases can also be used to prepare this report.

Multiple consolidation ranges: If the data lists are available in different worksheets, then by
using the option “consolidate” all the data ranges t can be used for Pivot table report.

Another PivotTable report: It is useful when, already a pivot table is created, and the same
data to be used to create multiple PivotTable reports.

Data Preparation

There are a few things to consider in preparing your Excel data:

Data should be in categorical: In the data list, there should be more than one categorical
variable (Institute, Head of Account, and Years etc. I the following example) and at least one
variable for summarize (Example: Plan, Non-Plan, and Total etc.)

Remove all automatic totals: If any formulas are existing in the data list, convert them into
values. Otherwise it will give wrong results

Query Data: If you want to include filtered data, use only the Advanced Filter command
(Data – Filter- Advanced Filter). With this option the filtered data will be kept in different
location. That filtered data only be used to generate Pivot table report

For the given data using Pivot table and pivot chart wizard generate the following reports

142
1. Generate a table: Rows: District: Columns: Years and Data: Rice Yield
2. Generate a table: Rows: States: Columns: Years: and Data: Production
3. Generate a table: Rows: States: Columns: Years: and Data: Area
4. Generate a table: Rows: States: Columns: Years: and Data: Fertilizer N Consumption
5. Generate a table: Rows: States: Columns: Years: and Data: Fertilizer P Consumption
6. Generate a table: Rows: States: Columns: Years: and Data: Fertilizer K Consumption
7. Generate a table: Rows: States: Columns: Years: and Data: Total Rice Area Irrigated
8. Generate a table: Rows: States: Columns: Years: and Data: Farmers Harvest Prices

Activate Microsoft Excel.

 Click on Start
 Click on Programs
 Click on Microsoft Excel

Open the Data File

 Select OPEN option from the FILE Menu


 Browse for the File APDATA.XLS from the DATA Folder
 Click on OPEN
 Observe that the data is starting from Cell A1 to Cell 683
 Name this worksheet as SOURCE DATA

Copy the Worksheet

 Select Entire worksheet


 Click on COPY Icon
 Click on SHEET2 Tab
 Position the cursor in cell A1
 Click on PASTE Icon

Preparing Pivot table

 Position the Mouse pointer in A1 Cell


 Click on Data Menu
 Click on Pivot Table and Pivot Chart Option. Then it will display Pivot table report
wizard.
 Select Microsoft Excel List or Database option as for “ Where is the data you want
to Analyze “
 Select Pivot Chart (With table) as the option for “ What kind of report do you want
to create”
 Click Next to go to next step of the wizard
 In the Next window, it is automatically selected the entire data range in the worksheet
 Click Next to go to next step of the wizard
 Click on Layout option to design required report
 In the Layout window, user has to select the Categorical variables for Rows, and
Column, and also select the variable for Data summarize. In this example

143
Preparing report for Rice Yield

 Click on the field YEAR, drag and drop in the area named as COLUMN in the
Layout Window
 Click on the field DISTNAME, drag and drop in the area named as ROWS in the
Layout Window
 Click on the field Rice_TY, drag and drop in the area named as DATA in the Layout
Window
 Double click on the Variable Rice_TY in the Data area and select AVERAGE as the
summarized function.
 Click OK
 Select the option NEW WORKSHEET to keep the results in the separate worksheet.
 Click on FINISH to execute the required report
 The report is displayed in the new worksheet
 Name this worksheet as YIELD

Calculation of Averages, Standard Deviation and Coefficient of Variation

1. Select entire worksheet


2. Click on COPY Icon
3. Click on SHEET3 tab
4. Position the cursor in Cell A1
5. Select PASTE SPECIAL from the EDIT Menu
6. Select VALUES as the option for PASTE
7. Click OK to convert all formulas into Values
8. Name this sheet as CV

Calculation of Averages

9. Position the cursor in Cell AG1


10. Type the Column heading as MEAN
11. Position the cursor in Cell AG2
12. Type the following formula to Calculate the Average

=AVERAGE (B2:AF2)

13. Position the cursor on AG2 and click on COPY Icon


14. Block the cells from AG3 to AG23 and click on PASTE Icon to fill the values by
using the above formula AG2

Calculation of Standard Deviation

15. Position the cursor in Cell AH1


16. Type the Column heading as STANDARD DEVIATION
17. Position the cursor in Cell AH2
18. Type the following formula to Calculate the Standard Deviation

=STDEV (B2:AF2)

19. Position the cursor on AH2 and click on COPY Icon


Block the cells from AH3 to AH23 and click on PASTE Icon to fill the values by
using the above formula AH2.

144
Calculation of Coefficient Variation (%)

20. Position the cursor in Cell AI1


21. Type the Column heading as CV (%)
22. Position the cursor in Cell AI2
23. Type the following formula to Calculate the CV

= AH2/AG2 * 100

24. Fill the cell from AI3 to AI23 using the COPY Icon from the Cell AI2

Calculation of State wise Growth rates

1. Block the entire data from Cell A1 to AF1 from the CV Worksheet
2. Click on COPY Icon.
3. Position the cursor in Cell A1
4. Select PASTE SPECIAL from the EDIT Menu
5. Select VALUES as the option for PASTE
6. Click OK to convert all formulas into Values
7. Name this sheet as Growth Rates

Converting into Natural Logarithmic values

8. Block the data from Cell A1 to AF1


9. Place the Pointer in Cell A25 and Click on PASTE Icon to copy the column headings.
10. Block the data from Cell A2 to A23
11. Place the Pointer in Cell A26 and Click on PASTE Icon to copy the Row headings
12. Position the cursor in Cell B26 and type the formula to convert the Value in Cell B2
into Logarithmic values.

=LN (B2)

13. Copy the formula in Cell B26 to Cells from Cells C26 to AF26
14. Similarly copy the same formula to other cells i.e Cell B27 to A47
15. Position cursor in Cell AJ25
16. Type the Column head as SLOPE
17. Position the cursor in Cell AJ26 and type the formula as shown below

= SLOPE (B26:AF26, $B$25: $AF$25)

18. Copy the cell AJ26 to AJ27 to AJ47


19. Position cursor in Cell AK25
20. Type the Column head as Growth Rates
21. Position the cursor in Cell AK26 and type the formula as shown below

=(EXP (AJ26)-1)*100

22. Copy the cell AK26 to AK27 to AK47

Arranging the data for Mapping

1. Block the cells from A1 to A23


2. Click on COPY Icon
3. Click on Sheet5
4. Position the Cursor in Cell A1 and Click on PASTE Icon

145
5. Similarly COPY the data of MEAN, Standard Deviation, CV and Growth Rates from
respective columns from the Growth Rates Sheet
6. Name this Sheet as Summary

Classify the Mean, as shown below

Mean Code

< 1500 1
1500.1750 2
1750.2000 3
2000.2250 4
2250.2500 5
> 2500 6

7. To get the above classification use the following formula in cell F2

=IF (B2<=1500,1,IF (B2<1750,2, (IF (B2<2000,3,IF (B2<2250,4,


(IF(B2<2500,5,6)))))))

8. Copy the same formula from Cell F2 to Cells F3 to F23


9. Classification for C.V (%) and Growth Rate (%) as per the following codes

C.V (%) Code


<15 1
15.25 2
25.35 3
> 35 4

Growth rate (%) Code

<1 1
1.2 2
2.3 3
>3 4

Depict the Classifications OF Mean, C.V (%) and Growth Rate (%) on Map

146