ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Pivot Table Calculated field item (https://www.excelbanter.com/excel-discussion-misc-queries/46982-pivot-table-calculated-field-item.html)

Tim

Pivot Table Calculated field item
 
Hi,
I want to create a calculated field that uses an if to base its calculation
results.

Therefore i have a field called Site which is a text and another field
called materials which is the number of materials.

=if(Site="Mexico", materials*300, materials*2000)

I have tried this and it doesnt compute based on the Site field or at least
the text isnt matching as I have changed the Site to Mexico and it still
calculates based on the 2000 amount. Anyone know why?

Thanks,
Tim

Debra Dalgleish

Since Site is a text field, the calculated field will evaluate all Sites
as zero. So, materials for all sites will be multiplied by 2000.

Perhaps you could add a column to the source data, and do the
calculation there, then add the new field to the pivot table.

Tim wrote:
Hi,
I want to create a calculated field that uses an if to base its calculation
results.

Therefore i have a field called Site which is a text and another field
called materials which is the number of materials.

=if(Site="Mexico", materials*300, materials*2000)

I have tried this and it doesnt compute based on the Site field or at least
the text isnt matching as I have changed the Site to Mexico and it still
calculates based on the 2000 amount. Anyone know why?

Thanks,
Tim



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 01:17 PM.

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