# Weighted Averages in a PivotTable

Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Weighted Averages in a PivotTable.

A good example of how to use calculated fields is for summarizing data differently than you can normally summarize it with a PivotTable. When you create a PivotTable, you can use several different functions to summarize the data that is displayed. For instance, you can create an average of data in a particular field. What if you want to create a weighted average, however? Excel doesn't provide a function that automatically allows you to do this.

When you have special needs for summations—like weighted averages—the easiest way to achieve your goal is to add an additional column in the source data as an intermediate calculation, and then add a calculated field to the actual PivotTable.

For example, you could add a "WeightedValue" column to your source data. The formula in the column should multiply the weight times the value to be weighted. This means that if your weight is in column C and your value to be weighted is in column D, your formula in the WeightedValue column would simply be like =C2*D2. This formula will be copied down the entire column for all the rows of the data.

You are now ready to create your PivotTable, which you should do as normal with one exception: you need to create a Calculated Field. Follow these steps:

1. Click the down arrow next to the word PivotTable at the left side of the PivotTable toolbar. Excel displays a menu.
2. Choose Formulas | Calculated Fields. Excel displays the Insert Calculated Field dialog box. (See Figure 1.)
3. Figure 1. The Insert Calculated Field dialog box.

4. In the Name box, enter a name for your new field.
5. In the Formula box, enter the formula you want used for your weighted average, such as =WeightedValue/Weight. (You use field names in the formula; you can select them from the field list at the bottom of the Insert Calculated Field dialog box.)
6. Click OK.

Your calculated field is now inserted, and you can use the regular summation functions to display a sum of the calculated field; this is your weighted average.

Since there are many different ways that weighted averages can be calculated, it should go without saying that you can modify the formulas and steps presented here to reflect exactly what you need done with your data.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2900) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Weighted Averages in a PivotTable.

Related Tips:

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

 *Name: Email: Notify me about new comments ONLY FOR THIS TIP Notify me about new comments ANYWHERE ON THIS SITE Hide my email address *Text: *What is 5+3 (To prevent automated submissions and spam.)

IA    24 Aug 2016, 13:18
Your suggestion worked perfectly for me. Thanks!
Declan     21 Mar 2016, 06:53
Can i put a weighted average as a subtotal and/or grand total in a pivot table?
Your tip only gives me the total weighted value, how do i get to put the average of the total weighted value into the grand total or subtotal row?
Drew    18 May 2015, 15:49
reinhold23    01 May 2015, 16:25
Thanks, this worked great!
Peter    28 May 2014, 15:18
This method produced valid results for me. Many thanks.
Panther68    21 Aug 2013, 10:55

# Our Company

Sharon Parq Associates, Inc.

# Our Sites

Tips.Net

Beauty and Style

Cars

Cleaning

Cooking

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)

Gardening

Health

Home Improvement

Money and Finances

Organizing

Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Excel Products

Word Products

# Our Authors

Author Index

Write for Tips.Net