[]
The criterion specifies the range of values and the threshold type associated with the icon in an icon set conditional formatting rule. Each IIconCriterion defines the threshold settings for one icon, including its icon, comparison operator, threshold type, threshold value, and position within the icon set.
IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
IIconCriterion criterion = condition.getIconCriteria().get(1);
criterion.setType(ConditionValueTypes.Number);
criterion.setValue(50);
getIcon()intgetIndex()FormatConditionOperator enumeration, which specifies whether the threshold is "greater than" or "greater than or equal to" the threshold value.getType()ConditionValueTypes enumeration, which specifies how the threshold value for an icon set is determined.getValue()voidvoidFormatConditionOperator enumeration, which specifies whether the threshold is greater than or greater than or equal to the threshold value.voidsetType(ConditionValueTypes value) ConditionValueTypes enumeration, which specifies how the threshold value for an icon set is determined.voidUse this method to retrieve the icon currently assigned to a specific threshold in an icon set rule.
IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
IIconCriterion criterion = condition.getIconCriteria().get(1);
IconType icon = criterion.getIcon();
IconType value assigned to the criterion.Use this method to change the icon assigned to a specific threshold in an icon set rule.
IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
IIconCriterion criterion = condition.getIconCriteria().get(1);
criterion.setIcon(IconType.RedCross);
value - The IconType value to assign to the criterion.Use this property to identify the position of an icon criterion within an icon set conditional formatting rule.
IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
IIconCriterion criterion = condition.getIconCriteria().get(1);
int index = criterion.getIndex();
IIconCriteria collection.FormatConditionOperator enumeration, which specifies whether the threshold is "greater than" or "greater than or equal to" the threshold value. For an icon set conditional formatting rule, the returned value indicates how this criterion compares cell values against its threshold.
IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
IIconCriterion criterion = condition.getIconCriteria().get(1);
criterion.setOperator(FormatConditionOperator.GreaterEqual);
FormatConditionOperator operator = criterion.getOperator();
FormatConditionOperator.Greater or FormatConditionOperator.GreaterEqual.FormatConditionOperator enumeration, which specifies whether the threshold is greater than or greater than or equal to the threshold value. For an icon set conditional formatting rule, this property can be set only to FormatConditionOperator.Greater or FormatConditionOperator.GreaterEqual.
IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
IIconCriterion criterion = condition.getIconCriteria().get(1);
criterion.setOperator(FormatConditionOperator.GreaterEqual);
value - The comparison operator for the icon threshold. Use FormatConditionOperator.Greater or FormatConditionOperator.GreaterEqual.ConditionValueTypes enumeration, which specifies how the threshold value for an icon set is determined. Use this method to inspect whether the criterion threshold is interpreted as a number, percent, percentile, formula, or another supported condition value type.
IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
IIconCriterion criterion = condition.getIconCriteria().get(1);
criterion.setType(ConditionValueTypes.Percent);
ConditionValueTypes type = criterion.getType();
ConditionValueTypes enumeration that indicates how the threshold value for the icon criterion is determined.ConditionValueTypes enumeration, which specifies how the threshold value for an icon set is determined. Use this method to control how the icon criterion interprets its threshold value, such as a fixed number, percentage, percentile, formula, or range-based minimum or maximum.
worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {30}, {50}, {70}, {90}});
IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
IIconCriterion criterion = condition.getIconCriteria().get(1);
criterion.setType(ConditionValueTypes.Percent);
criterion.setValue(60);
value - The ConditionValueTypes constant that specifies how the threshold value for the icon criterion is determined.The returned value corresponds to the threshold configured for this icon criterion, such as a number, percentage, percentile, or formula value, depending on the criterion type.
IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
IIconCriterion criterion = condition.getIconCriteria().get(1);
criterion.setType(ConditionValueTypes.Percent);
criterion.setValue(50);
Object value = criterion.getValue();
The specified value becomes the threshold for this icon criterion, such as a number, percentage, percentile, or formula value, depending on the criterion type.
IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
IIconCriterion criterion = condition.getIconCriteria().get(1);
criterion.setType(ConditionValueTypes.Percent);
criterion.setValue(50);
value - The threshold value for the icon criterion.