XL.ConditionalFormating.Add3ColorScaleFormulaRule
-------------------------------------------------

Adds a conditional formatting rule that creates a gradated 3-color scale on the cells.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [XL](component_XL.md) | [14.2](newinversion142.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "XL.ConditionalFormating.Add3ColorScaleFormulaRule"; BookRef; ConditionalFormattingRef; minColor; maxColor { ; minType; minValue; midType; midValue; maxType; maxValue; StopIfTrue } ) 

**MBS**( **"XL.ConditionalFormating.Add3ColorScaleFormulaRule";** /\* Adds a conditional formatting rule that creates a gradated 3-color scale on the cells. \*/  
**$BookRef**; /\* The reference number for the workbook.e.g. $ref \*/   
**$ConditionalFormattingRef**; /\* The reference number for the conditional formatting.e.g. $ConditionalFormatting \*/   
**$minColor**; /\* the color for minimum \*/   
**$maxColor**; /\* the color for maximum \*/   
**$minType**; /\* Optional; the type of minValue, see values below.  
Defaults to 2 for CFVO\_FORMULA.e.g. 2 \*/   
**$minValue**; /\* Optional; The formula expression for minimum.  
Defaults to "".e.g. "" \*/   
**$midType**; /\* Optional; the type of midValue, see values below.  
Defaults to 2 for CFVO\_FORMULA.e.g. 2 \*/   
**$midValue**; /\* Optional; The formula expression for midpoint.  
Defaults to "".e.g. "" \*/   
**$maxType**; /\* Optional; The type of maxValue, see values below.  
Defaults to 2 for CFVO\_FORMULA.e.g. 2 \*/   
**$maxValue**; /\* Optional; The formula expression for maximum.  
Defaults to "".e.g. "" \*/   
**$StopIfTrue**) /\* Optional; If true, no rules with lower priority may be applied over this rule, when this rule is true.  
Defaults to false.e.g. false \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| BookRef | The reference number for the workbook. | $ref |  |
| ConditionalFormattingRef | The reference number for the conditional formatting. | $ConditionalFormatting |  |
| minColor | the color for minimum |  |  |
| maxColor | the color for maximum |  |  |
| minType | the type of minValue, see values below.   Defaults to 2 for CFVO\_FORMULA. | 2 | Optional |
| minValue | The formula expression for minimum.   Defaults to "". | "" | Optional |
| midType | the type of midValue, see values below.   Defaults to 2 for CFVO\_FORMULA. | 2 | Optional |
| midValue | The formula expression for midpoint.   Defaults to "". | "" | Optional |
| maxType | The type of maxValue, see values below.   Defaults to 2 for CFVO\_FORMULA. | 2 | Optional |
| maxValue | The formula expression for maximum.   Defaults to "". | "" | Optional |
| StopIfTrue | If true, no rules with lower priority may be applied over this rule, when this rule is true.   Defaults to false. | false | Optional |

### Result

Returns OK or error.

### Description

Adds a conditional formatting rule that creates a gradated 3-color scale on the cells.  
Possible values for minType, midType and maxType parameters:  
| Name | Value | Description |
|---|---|---|
| CFVO\_MIN | 0 | indicates that the minimum value in the range shall be used as the minimum value for the gradient |
| CFVO\_MAX | 1 | indicates that the maximum value in the range shall be used as the maximum value for the gradient |
| CFVO\_FORMULA | 2 | the minimum/midpoint/maximum value for the gradient is determined by a formula |
| CFVO\_NUMBER | 3 | indicates that the minimum/midpoint/maximum value for the gradient is specified by a constant numeric value |
| CFVO\_PERCENT | 4 | value indicates a percentage between the minimum and maximum values in the range shall be used as the minimum/midpoint/maximum value for the gradient |
| CFVO\_PERCENTILE | 5 | value indicates a percentile ranking in the range shall be used as the minimum/midpoint/maximum value for the gradient |

### See also

- [XL.ConditionalFormating.Add2ColorScaleFormulaRule](XLConditionalFormatingAdd2ColorScaleFormulaRule.md)
- [XL.ConditionalFormating.Add2ColorScaleRule](XLConditionalFormatingAdd2ColorScaleRule.md)
- [XL.ConditionalFormating.Add3ColorScaleRule](XLConditionalFormatingAdd3ColorScaleRule.md)

### Blog Entries

- [Conditional Formatting in Excel exports from FileMaker](https://www.mbsplugins.de/archive/2024-04-08/Conditional_Formatting_in_Exce/monkeybreadsoftware_blog_filemaker)

Created 30th March 2024 , last changed 31st March 2024

  
[XL.ConditionalFormating.Add2ColorScaleRule](XLConditionalFormatingAdd2ColorScaleRule.md) - [XL.ConditionalFormating.Add3ColorScaleRule](XLConditionalFormatingAdd3ColorScaleRule.md)

[HTML Version](XLConditionalFormatingAdd3ColorScaleFormulaRule.shtml)