Help with calculated fields

DrBacon

New Member
Joined
Sep 4, 2018
Messages
27
Hello all,

I have a question when using calculated fields in pivot tables. I have a set of surveys, where each number means either negative, null, or positive. What I want the calculated field to do is the following formula:

(count of all positives - count of all negatives)/sum(positives+negatives+nulls)

what I tried to do is the following (the field being calculated is called OS or "overall satisfaction")

=((OS="Positive")-(OS="Negative"))/((OS="Positive")+(OS="Null")+(OS="Negative")

But the result just returns a 1

What could I do?

Cheers
Bacon
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Is this the NPS score you're calculating? You're on the right track: Just multiply the percentage you're getting with 100 and round to 0 decimals.

The whole formula should look something like:

=ROUND((COUNTIFS(B2:B51;"Positive")-COUNTIFS(B2:B51;"Negative"))/ROWS(B2:B51)*100;0)

(Or if you're not trying to calculate the NPS just format the number from the original formula as percentage.)
 
Upvote 0
I thought you could not use ranges in Calculated fields in pivot tables?

But yes, this is an NPS
 
Upvote 0
Since you're already using Pivot Tables you might want to do the whole thing in Power Pivot.

To do this you're basically going to need two types of formulas:

Answers:=COUNTROWS(YourTableName)
Positives:=CALCULATE([Answers],YourTableName[YourColumnName]>8)
Negatives:=CALCULATE([Answers],YourTableName[YourColumnName]<7)

NPS:=ROUND(DIVIDE([Positives]-[Negatives],[Answers])*100,0)
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,245
Members
448,555
Latest member
RobertJones1986

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