#region TODO //TODO: Add the "DataBar" extended options //TODO: Add tests for all the rules //TODO: Add the IconSet options //TODO: Add all the "extList" options #endregion #region §18.3.1.18 conditionalFormatting (Conditional Formatting) //Childs: //cfRule (Conditional Formatting Rule) §18.3.1.10 //extLst (Future Feature Data Storage Area) §18.2.10 //Attributes: //pivot //sqref ST_Sqref simple type (§18.18.76) #endregion #region §18.3.1.10 cfRule (Conditional Formatting Rule) //Childs: //colorScale (Color Scale) §18.3.1.16 //dataBar (Data Bar) §18.3.1.28 //extLst (Future Feature Data Storage Area) §18.2.10 //formula (Formula) §18.3.1.43 //iconSet (Icon Set) §18.3.1.49 //Attributes: //----------- //priority (Priority) The priority of this conditional formatting rule. This value is used to determine which // format should be evaluated and rendered. Lower numeric values are higher priority than // higher numeric values, where 1 is the highest priority. //stopIfTrue (Stop If True) If this flag is 1, no rules with lower priority shall be applied over this rule, when this rule // evaluates to true. //type (Type) Type of conditional formatting rule. ST_CfType §18.18.12. //aboveAverage Indicates whether the rule is an "above average" rule. 1 indicates 'above average'. // This attribute is ignored if type is not equal to aboveAverage. //equalAverage (Equal Average) // Flag indicating whether the 'aboveAverage' and 'belowAverage' criteria is inclusive of the // average itself, or exclusive of that value. 1 indicates to include the average value in the // criteria. This attribute is ignored if type is not equal to aboveAverage. //bottom (Bottom N) Indicates whether a "top/bottom n" rule is a "bottom n" rule. 1 indicates 'bottom'. // This attribute is ignored if type is not equal to top10. //dxfId (Differential Formatting Id) // This is an index to a dxf element in the Styles Part indicating which cell formatting to // apply when the conditional formatting rule criteria is met. ST_DxfId simple type (§18.18.25). //operator (Operator) The operator in a "cell value is" conditional formatting rule. This attribute is ignored if // type is not equal to cellIs. The possible values ST_ConditionalFormattingOperator simple type (§18.18.15). //percent (Top 10 Percent) // Indicates whether a "top/bottom n" rule is a "top/bottom n percent" rule. This attribute // is ignored if type is not equal to top10. //rank (Rank) The value of "n" in a "top/bottom n" conditional formatting rule. This attribute is ignored // if type is not equal to top10. //stdDev (StdDev) The number of standard deviations to include above or below the average in the // conditional formatting rule. This attribute is ignored if type is not equal to aboveAverage. // If a value is present for stdDev and the rule type = aboveAverage, then this rule is automatically an // "above or below N standard deviations" rule. //text (Text) The text value in a "text contains" conditional formatting rule. This attribute is ignored if // type is not equal to containsText. //timePeriod (Time Period) The applicable time period in a "date occurring…" conditional formatting rule. This // attribute is ignored if type is not equal to timePeriod. ST_TimePeriod §18.18.82. #endregion #region Conditional Formatting XML examples // All the examples are assumed to be inside #region Example "beginsWith" // // LEFT(A1,LEN("a"))="a" // // // LEFT(A3,LEN("""<>"))="""<>" // #endregion #region Example "between" // // 3 // 7 // #endregion #region Example "containsText" // // NOT(ISERROR(SEARCH("c",A1))) // #endregion #region Example "endsWith" // // RIGHT(A1,LEN("c"))="c" // #endregion #region Example "equal" // // "ab" // #endregion #region Example "greaterThan" // // 4 // #endregion #region Example "greaterThanOrEqual" // // 4 // #endregion #region Example "lessThan" // // 4 // #endregion #region Example "lessThanOrEqual" // // 4 // #endregion #region Example "notBetween" // // 3 // 7 // #endregion #region Example "notContainsText" // // ISERROR(SEARCH("c",A1)) // #endregion #region Example "notEqual" // // "ab" // #endregion #region Example "containsBlanks" // // LEN(TRIM(A1))=0 // #endregion #region Example "containsErrors" // // ISERROR(A1) // #endregion #region Example "expression" // // RIGHT(J16,1)="b" // #endregion #region Example "duplicateValues" // #endregion #region Example "notContainsBlanks" // // LEN(TRIM(A1))>0 // #endregion #region Example "notContainsErrors" // // NOT(ISERROR(A1)) // #endregion #region Example "uniqueValues" // #endregion #region Example "last7Days" // // AND(TODAY()-FLOOR(A1,1)<=6,FLOOR(A1,1)<=TODAY()) // #endregion #region Example "lastMonth" // // AND(MONTH(A1)=MONTH(EDATE(TODAY(),0-1)),YEAR(A1)=YEAR(EDATE(TODAY(),0-1))) // #endregion #region Example "lastWeek" // // AND(TODAY()-ROUNDDOWN(A1,0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(A1,0)<(WEEKDAY(TODAY())+7)) // #endregion #region Example "nextMonth" // // AND(MONTH(A1)=MONTH(EDATE(TODAY(),0+1)),YEAR(A1)=YEAR(EDATE(TODAY(),0+1))) // #endregion #region Example "nextWeek" // // AND(ROUNDDOWN(A1,0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(A1,0)-TODAY()<(15-WEEKDAY(TODAY()))) // #endregion #region Example "thisMonth" // // AND(MONTH(A1)=MONTH(TODAY()),YEAR(A1)=YEAR(TODAY())) // #endregion #region Example "thisWeek" // // AND(TODAY()-ROUNDDOWN(A1,0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(A1,0)-TODAY()<=7-WEEKDAY(TODAY())) // #endregion #region Example "today" // // FLOOR(A1,1)=TODAY() // #endregion #region Example "tomorrow" // // FLOOR(A1,1)=TODAY()+1 // #endregion #region Example "yesterday" // // FLOOR(A1,1)=TODAY()-1 // #endregion #region Example "twoColorScale" // // // // // // // // #endregion #region Examples "iconSet3" (x all the 3 IconSet options) // // // // // // // // // // // // // // #endregion #region Examples "iconSet4" (x all the 4 IconSet options) // // // // // // // // #endregion #region Examples "iconSet5" (x all the 5 IconSet options) // // // // // // // // // #endregion #region Examples "iconSet" Extended (not implemented yet) // // // // // // // // 0 // // // 33 // // // 67 // // // // C3:C12 // // // // // // 0 // // // 33 // // // 67 // // // // A16:A25 // // // // // // 0 // // // 33 // // // 67 // // // // C16:C25 // // // // // // 0 // // // 20 // // // 40 // // // 60 // // // 80 // // // // E16:E25 // // // // // // 0 // // // $F$17 // // // 4 // // // // // // // F16:F25 // // // // #endregion #endregion