Skip to content

Commit 3cc65df

Browse files
authored
Inform about the TRUE and FALSE constants in the compatiblity-with-google-sheets guide (#1550)
1 parent 270da75 commit 3cc65df

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/guide/compatibility-with-google-sheets.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ Still, with the right configuration, you can achieve nearly full compatibility.
1515

1616
## Configure compatibility with Google Sheets
1717

18+
### `TRUE` and `FALSE` constants
19+
20+
Google Sheets has built-in constants (keywords) for the boolean values (`TRUE` and `FALSE`).
21+
22+
To set up HyperFormula in the same way, define `TRUE` and `FALSE` as [named expressions](named-expressions.md), by using HyperFormula's [`TRUE`](built-in-functions.md#logical) and [`FALSE`](built-in-functions.md#logical) functions.
23+
24+
```js
25+
hfInstance.addNamedExpression('TRUE', '=TRUE()');
26+
hfInstance.addNamedExpression('FALSE', '=FALSE()');
27+
```
28+
1829
### Array arithmetic mode
1930

2031
In Google Sheets, the [array arithmetic mode](arrays.md#array-arithmetic-mode) is disabled by default.
@@ -97,4 +108,11 @@ const options = {
97108
leapYear1900: false, // set by default
98109
smartRounding: true, // set by default
99110
};
111+
112+
// call the static method to build a new instance
113+
const hfInstance = HyperFormula.buildEmpty(options);
114+
115+
// define TRUE and FALSE constants
116+
hfInstance.addNamedExpression('TRUE', '=TRUE()');
117+
hfInstance.addNamedExpression('FALSE', '=FALSE()');
100118
```

0 commit comments

Comments
 (0)