This article describes how to edit the underlying JavaScript in a Rule that has been applied to a table...
...so you can, for example, reverse a condition to apply text to cells larger than a specific value so that it instead does this for cells that are smaller than this value:
Requirements
- A table with a Rule applied. This article uses the example from How to Add Text to Table Cells with Large Numbers. Note, Highlight Cells, Top/Bottom, Color Scale, and Data Bars Rules cannot be modified in this way.
Method
1. Select your table.
2. Go to the Rules tab.
3. Right-click the Rule you wish to edit > Edit > Edit JavaScript > OK.
4. Amend the JavaScript code where necessary. In this example, we can identify the part of the code that applies the condition as follows:
if (value > threshold) {
To reverse this condition so that it applies instead when under this threshold, we would change this to:
if (value < threshold) {
5. Press the Play button > Close > OK > OK.
Note, if this Rule was originally applied to multiple tables at the same time, you have selected the Use for new table and charts option, or this is a copy of a table that had the Rule already applied, this change will apply to all these instances of the Rule.