ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How can I use nested IF using OR in a pivot table? (https://www.excelbanter.com/excel-worksheet-functions/108211-how-can-i-use-nested-if-using-pivot-table.html)

paperclip

How can I use nested IF using OR in a pivot table?
 
I would like the calculated formula in a pivot table to use one percent for a
field name if true or a different percent if false. Below is what I have
come up with but it returns always 100%.

=IF(OR(Offset_AccountName="52 - BALD CUT",Offset_AccountName="72 - WIRE &
NUT",Offset_AccountName="17 - APPLE CORE"),'Weight (oz)'*25%,'Weight
(oz)'*100%)


Debra Dalgleish

How can I use nested IF using OR in a pivot table?
 
The calculated formula won't recognize the text values, so it will use
the second part of the IF formula for all items.

You could add a column to the pivot table source data, where you
calculate the percentage. Then, add that field to the pivot table, and
it should work correctly.

paperclip wrote:
I would like the calculated formula in a pivot table to use one percent for a
field name if true or a different percent if false. Below is what I have
come up with but it returns always 100%.

=IF(OR(Offset_AccountName="52 - BALD CUT",Offset_AccountName="72 - WIRE &
NUT",Offset_AccountName="17 - APPLE CORE"),'Weight (oz)'*25%,'Weight
(oz)'*100%)



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


paperclip

How can I use nested IF using OR in a pivot table?
 
It is a fresh download everytime. My best option would be for someone to
enhance the calculated formula to accept any kind of formula :). In the
meantime I'll either do a Getpivotdata or a macro on the data dump. Thanks
for your help at least I won't keep trying to make it work.

"Debra Dalgleish" wrote:

The calculated formula won't recognize the text values, so it will use
the second part of the IF formula for all items.

You could add a column to the pivot table source data, where you
calculate the percentage. Then, add that field to the pivot table, and
it should work correctly.

paperclip wrote:
I would like the calculated formula in a pivot table to use one percent for a
field name if true or a different percent if false. Below is what I have
come up with but it returns always 100%.

=IF(OR(Offset_AccountName="52 - BALD CUT",Offset_AccountName="72 - WIRE &
NUT",Offset_AccountName="17 - APPLE CORE"),'Weight (oz)'*25%,'Weight
(oz)'*100%)



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html




All times are GMT +1. The time now is 12:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com