why is this simple calculated field not working

Siyanna

Well-known Member
Joined
Nov 7, 2011
Messages
1,146
Hi All,

I have created a pivot table that looks like this

Count of Passed/FailedPassed/Failed
Start DateFailedPassed(blank)Grand Total
Jan37190227
Feb23102125
Oct52190242
Nov36143179
Grand Total148625773

<colgroup><col><col span="3"><col></colgroup><tbody>
</tbody>


the Failed and passed are items of the passed/Failed field
All i want to do is add a calculated field that just takes the difference from passed and diff and then add this to the pivot chart but it does not work saying i cant add formula

this is the steps im following on excel 2013

highlight pivot table
Analyze
fields, item, sets
Calculated field
name = diff
formula =Passed-Failed (i have even tried ='Passed'-'Failed' with no luck

Hopefully some can explain how to get around this

Thank YOu
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Calculated fields only use SUM for their field aggregations. If you don't have Power Pivot, you can add new counter columns to the data source that return either 1 or 0 as applicable and then sum those as a count.
 
Upvote 0
thank you

this is what ive done - added 2 columns that returns does this

DiffPassed =IF([@[Passed/Failed]]="Passed",1,0)
DiffFailed = =IF([@[Passed/Failed]]="Failed",1,0)

still dont get the difference - all im trying to do is add the difference - thank you
 
Upvote 0
You want a calculated item, not a calculated field, if Passed and Failed are in the same column.
 
Upvote 0
i tried adding a calculated item also but getting the message cant add it to a grouped field - what steps do i need to follow

Really appreciate it
 
Upvote 0
You'll have to ungroup the field, or use your two new columns to create a calculated field. What problem did you have with the latter?
 
Upvote 0
Hi - i managed to get around it by doing the following

Added 1 column that gave 1 if it was passed and the same for another column if it failed

for the pivot table - i added the sum of these 2 columns in the values field and the count was then used adding a calculated field ising these 2 new columns

thanks for your help
 
Upvote 0
I’m having the same problem, formula I’m using is =if(amount > 100000, 3%* amount, 0) but result is zero
 
Upvote 0

Forum statistics

Threads
1,215,256
Messages
6,123,915
Members
449,132
Latest member
Rosie14

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