Calculated Fields and Text

Tarver

Board Regular
Joined
Nov 15, 2012
Messages
113
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
In a pivot table, can I insert a calculated field to evaluate a text entry?

My calculated field is
=IF(DESCRIPTION="C",AMOUNT*10)

My result is always 0, regardless of whether or not the corresponding entry is a C or not.

If I reverse it and make my field look for inequality, I get this:
=IF(DESCRIPTION<>"C",AMOUNT*10)

This results in every single entry (even those that are C) being multiplied by 10.

What am I missing?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Is "DESCRIPTION" and "AMOUNT" a named cell? If not, then your issue is that excel doesn't know where to look for these. For example;

Use
Code:
=IF(B2="C",C2*10,0)

If you have your table set up as
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Name
[/TD]
[TD]Description
[/TD]
[TD]Amount
[/TD]
[TD]Formula
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]A
[/TD]
[TD]C
[/TD]
[TD]10
[/TD]
[TD]100
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]B
[/TD]
[TD]A
[/TD]
[TD]10
[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
Thanks for your response.

No, "DESCRIPTION" and "AMOUNT" are not named ranges. They are the fields in the PivotTable that I'm working with. In the PivotTable Calculated Field options box, it's possible to refer to those fields in building a formula for the Pivot Table to evaluate.

The formula that evaluates the contents of "DESCRIPTION" as being NOT equal to an entry works, so I know the formula is at least being processed. However, there's a syntax issue or some other limitation that I'm not aware of which is keeping the formula from working properly when the formula asks to evaluate DESCRIPTION as being equal to any text string.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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