使用IF函数在excel中的数据透视表中添加计算字段,以选择不同的颜色 [英] Add a calculated field in a pivot table in excel with the IF function to choose a different color
本文介绍了使用IF函数在excel中的数据透视表中添加计算字段,以选择不同的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在excel的数据透视表中添加一个计算字段。我知道该怎么做,但这次我必须将此字段的颜色设置为红色或绿色,具体取决于所得到的previuos计算字段的值。如果结果为正,则新字段必须为绿色,否则为红色。
我无法将IF功能放入现场,因为我可以找不到如何设置颜色。
我尝试过:
我试过使用VBA代码,但我仍然不能这样做
I want to add a calculated field in a pivot table in excel. I know how to do that, but this time i have to colour red or green this field, depending of the value of a resulting previuos calculated field. If the result is positive the new field must be green, if not, red.
I have not been able to put the IF function in the field, because i can't find how to set the color.
What I have tried:
I have tried to use VBA code, but I still can't do it
推荐答案
你需要使用条件格式来做到这一点...... FormatConditions.Add Method(Excel) [ ^ ]
You need to use "Conditional Formatting" to do that ... FormatConditions.Add Method (Excel)[^]
这篇关于使用IF函数在excel中的数据透视表中添加计算字段,以选择不同的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文