EDUCBA

EDUCBA

MENUMENU
  • Blog
  • All Courses
  • All in One Bundle
  • Login
Home Excel Excel Resources Excel Tips Pivot Table Formula in Excel

Pivot Table Formula in Excel

Madhuri Thakur
Article byMadhuri Thakur

Updated June 13, 2023

Pivot Table Formula in Excel

Pivot Table Formula in Excel

We can add and modify the formula available in default calculated fields in Excel once we create a pivot table. To see and update the pivot table formula, create a table with relevant fields we want to keep. After selecting or putting the cursor on it, select Calculated Fields from the drop-down list of Fields, Items & Sets from Analyze menu ribbon. We will see all the fields used in the pivot table along with the section Name and Formula section.

Custom Field to Calculate Profit Amount

You can download this Pivot Table Formula Excel Template here – Pivot Table Formula Excel Template

This is the most often used calculated field in the pivot table. Please look at the data below; I have the Country Name, Product Name, Units Sold, Unit Price, Gross Sales, COGS (Cost of Goods Sold), Date, and Year columns.

Pivot Table Formula in Excel 1

Let me apply the pivot table to find each country’s total sales and cost. Below is the pivot table for the above data.

Pivot Table Formula in Excel 2

Pivot Table Formula in Excel 3

The problem is I don’t have a profit column in the source data. I need to find out the profit and profit percentage for each country. We can add these two columns to the pivot table itself.

Step 1: Select a cell in the pivot table. Go to Analyze tab in the ribbon and select Fields, Items, & Sets. Under this, select Calculated Field.

Pivot Table Formula in Excel 4

Step 2: Name your new calculated field in the dialog box below.

Pivot Table Formula in Excel 5

Step 3: In the Formula section, apply the formula to find the profit. The formula to find the Profit is Gross Sales – COGS.

Go inside the formula bar > Select Gross Sales from the below field and double click it will appear in the Formula bar.

Pivot Table Formula in Excel 6

Now type minus symbol ( – ) and select COGS > Double click.

Pivot Table Formula in Excel 7

Step 4: Click on ADD and OK to complete the formula.

Pivot Table Formula in Excel 7.1

Step 5: Now, we have our TOTAL PROFIT Column in the pivot table.

Pivot Table Formula in Excel 8

This calculated field is flexible, not limited to Country-wise analysis, but we can use this for all kinds of analysis. If I want to see the analysis country-wise and product-wise, I have to drag and drop the product column to the ROW field; it will show the breakup of profit for each product under each country.

Pivot Table Formula in Excel 9

Pivot Table Formula in Excel 10

Step 6: Now, we need to calculate the profit percentage. The formula to calculate the Profit Percentage is Total Profit / Gross Sales.

Go to Analyze and select Calculated Field under Fields, Items, & Sets again.

Step 7: Now, we must see the newly inserted calculated field Total Profit in the Fields list. Insert this field into the formula.

Pivot Table Formula in Excel 11

Step 8: Type divider symbol (/) and insert Gross Sales Field.

Pivot Table Formula in Excel 12

Step 9: Name this Calculated Field as Profit Percentage.

Pivot Table Formula in Excel 13

Step 10: Click on ADD and OK to complete the formula. We have Profit Percentage as the new column.

Pivot Table Formula in Excel 14

Advanced Formula in Calculated Field

Whatever I have shown now is the basic stuff of Calculated Field. This example will show you the advanced formulas in pivot table calculated fields. Now I want to calculate the incentive amount based on the profit percentage.

If the Profit % is >15% incentive should be 6% of the total profit.

If the Profit % is >10% incentive should be 5% of the total profit.

If the Profit % is <10% incentive should be 3% of the total profit.

Step 1: Go to Calculated Field and open the below dialog box. Give the name as Incentive Amount.

Advanced Formula in Calculated Field 1

Step 2: Now, I will use the IF condition to calculate the incentive amount. Apply the below formulas as shown in the image.

=IF (‘ProfitPercentage’>15%, ‘TotalProft’*6%, IF(‘ProfitPercentage’>10%, ‘Total Proft’*5%, ‘Total Proft’ *3%))

Advanced Formula in Calculated Field 2

Step 3: Click on ADD & OK to complete. Now we have an Incentive Amount column.

Advanced Formula in Calculated Field 3

Limitation of Calculated Field

We have seen the wonder of Calculated Fields, but it also has some limitations. Now look at the image below; if I want to see the breakup of the Product-wise Incentive amount, we will have the wrong SUB TOTAL & GRAND TOTAL of INCENTIVE AMOUNT.

Advanced Formula in Calculated Field 4

So be careful while showing the Subtotal of calculated fields. It will show you the wrong amounts.

Get a List of All the Calculated Field Formulas

If you do not know how many formulas are in the pivot table calculated field, you can get the summary of all these in a separate worksheet.

Go to Analyze > Fields, Items, & Sets –> List Formulas.

Advanced Formula in Calculated Field 5

It will give you a summary of all the formulas in a new worksheet.

Advanced Formula in Calculated Field 6

Things to Remember About Pivot Table Formula in Excel 

  • We can delete and modify all the calculated fields.
  • We cannot use formulas like VLOOKUP, SUMIF, and many other ranges-involved formulas in calculated fields, i.e., all the formulas which require range cannot be used.

Recommended Articles

This has been a guide to Pivot Table Formula in Excel. Here we discussed the Steps to Use the Formula of the Pivot Table in Excel, Examples, and a downloadable Excel template. You may also look at these useful functions in Excel –

  1. Pivot Table in Excel
  2. Excel Delete Pivot Table
  3. VBA Pivot Table
  4. VBA Refresh Pivot Table
MICROSOFT POWER BI Course Bundle - 8 Courses in 1
34+ Hours of HD Videos
8 Courses
Verifiable Certificate of Completion
Lifetime Access
4.5
MS Excel & VBA for Data Science Course Bundle - 24 Courses in 1 | 10 Mock Tests
87+ Hours of HD Videos
24 Courses
10 Mock Tests & Quizzes
Verifiable Certificate of Completion
Lifetime Access
4.5
All-in-One Financial Analyst Masters Training Program Bundle - 550+ Courses | 300+ Mock Tests | 2000+ Hours | Lifetime |
2000+ Hours of HD Videos
43 Learning Paths
550+ Courses
Verifiable Certificate of Completion
Lifetime Access
4.9
All-in-One Data Science Bundle - 400+ Courses | 550+ Mock Tests | 2000+ Hours | Lifetime |
2000+ Hour of HD Videos
80 Learning Paths
400+ Courses
Verifiable Certificate of Completion
Lifetime Access
4.7
Primary Sidebar
Popular Course in this category
MS Excel Course Bundle - 36 Courses in 1 | 13 Mock Tests
 137+ Hours of HD Videos
36 Courses
13 Mock Tests & Quizzes
  Verifiable Certificate of Completion
  Lifetime Access
4.9
Price

View Course
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Excel Charts
  • Excel Tips
  • All Tutorials
Certification Courses
  • All Courses
  • Excel VBA Course - All in One Bundle
  • VBA Course
  • Excel Data Analysis Course
  • Excel for Marketing Course
  • Excel for Finance Course
  • Excel for HR Training

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

Download Pivot Table Formula Excel Template

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA
Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

Download Pivot Table Formula Excel Template

EDUCBA

डाउनलोड Pivot Table Formula Excel Template

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more