Calculated Field

Alan_CT06

New Member
Joined
Nov 6, 2023
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
I would like to create a calculated field in my pivot table.

My pivot table has three columns: City, Acct# and AcctStatus.

In the AcctStatus column, the entries are either "New" or "Existing".

In my Pivot Table, City is the Row Label and the Values are Count of Acct# and Count of AcctStatus.

I'd like to have a calculated column that gave a count of the rows for which the entry in AcctStatus column = "New", but I'm not making the proper entry in the Insert Calculated Field Formula Box.

What should go there?

Thanks,
 

Attachments

  • Pivot.png
    Pivot.png
    20.5 KB · Views: 8

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Maybe I'm not understanding. If you want to look at the counts for "New" only, why can't you add the AcctStatus to Filter?
 
Upvote 0
Solution
I'm afraid you can't do that with a normal Pivot Table.
One of the Limitations of pivot table calculated fields is:
"When referring to other pivot fields in a calculated field, the SUM of their values is always used (see example below). Any other functions or operations in the formula will apply to those SUMs"
Since Acct is text and does not have a Sum, it can't be used in the calculated field.
The easiest option is to add a column (field) NewAcct to your initial table with an if statement putting a 1 or 0 on each line and using that as a field in your pivot table.
An alternative would be to use PowerPivot.

Ref for quote: How to Create Excel Pivot Table Calculated Field Examples
 
Upvote 0
Maybe I'm not understanding. If you want to look at the counts for "New" only, why can't you add the AcctStatus to Filter?
Yes the filter would work. Haven't worked much with Pivot Tables.

Thank you.
 
Upvote 0
I'm afraid you can't do that with a normal Pivot Table.
One of the Limitations of pivot table calculated fields is:
"When referring to other pivot fields in a calculated field, the SUM of their values is always used (see example below). Any other functions or operations in the formula will apply to those SUMs"
Since Acct is text and does not have a Sum, it can't be used in the calculated field.
The easiest option is to add a column (field) NewAcct to your initial table with an if statement putting a 1 or 0 on each line and using that as a field in your pivot table.
An alternative would be to use PowerPivot.

Ref for quote: How to Create Excel Pivot Table Calculated Field Examples
Thank you. I'll check out PowerPivot also.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,954
Members
449,095
Latest member
nmaske

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