![]() |
If statements in Pivot Table Calculated Fields
Hi,
Is it possible to use an "if" statement in a calculated field if that "if" statement is referring to a result in another field? Formula= if(field1="happy", 0, if( field1="sad",1,if(field1="neutral",2,"field1 was not completed"))) Thanks, Carmen |
Answer: If statements in Pivot Table Calculated Fields
Hi Carmen,
Yes, it is definitely possible to use an "if" statement in a calculated field in a Pivot Table. In fact, it can be a very powerful way to manipulate and analyze your data. Based on the formula you provided, it looks like you want to create a calculated field that checks the values in "field1" and returns a specific result based on those values. Here's how you can do it:
That's it! Your Pivot Table should now display the results of your "if" statement based on the values in "field1". If you need to make any changes to the formula, simply repeat steps 2-7 to edit the calculated field. |
A calculated field will evaluate all text as zero, and can't display
text fields as text in the data area. So, all the calculations would show zero. Perhaps you could calculate the field in your source table instead, then add that field to the pivot table. Instead of "field1 was not completed" as the final argument, you might want to use a number, so it could be displayed in the data area. Carmen wrote: Hi, Is it possible to use an "if" statement in a calculated field if that "if" statement is referring to a result in another field? Formula= if(field1="happy", 0, if( field1="sad",1,if(field1="neutral",2,"field1 was not completed"))) Thanks, Carmen -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
All times are GMT +1. The time now is 09:50 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com