pivot table add field

olyavv13

New Member
Joined
Mar 6, 2019
Messages
1
Hello. I have below pivot table based on a database. Would it be possible to add a field in the pivot table based on the if/then condition? for instance, if grand total is >150K for that row, new column will show 1, if >100K but <150K, value shown will be 2, if <100K, value shown will be 3. Pivot table will be changing (rows removed/added) so i would like the values to be updated automatically in the last column of the pvt table, instead of adding this as a separate column outside of the pvt table.


Row Labels Sum Of Amount Calculated field
Apple 250,000 1
Banana 57,000 3
Beans 125,000 2
Orange 5,000 3
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Re: pvt table add field

Welcome to MrExcel,

Yes, you can add a calculated field to your pivot table using these steps:

1. Select any cell in the Pivot Table.

2. In the Ribbon: Pivot Table Tools Analyze > Calculations group > Fields Items & Sets button > Calculated field....

3. In the Insert Calculated Field window:
a. Enter Name of field to add
b. Enter formula referencing your Amounts field:
=IF(Amount >150000,1,IF(Amount >100000,2,3))
c. Click OK

It wasn't clear how you want to classify the boundaries of exactly 150K and 100K. You can modify the operands to >= as needed.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top