Function Index
Output Functions
imageIf(if_condition, path_true, path_false, type)
Displays an image in a cell (overflowing cell boundaries if necessary).
if_condition:
If non‑zero, path_true is displayed; otherwise path_false.
path_true / path_false:
Image file paths or names.
- If type = 1: paths refer to external disk files (e.g., e:\image_file1.png).
- If type = 0: names refer to images inserted into the workbook using Insert > Image.
The list of inserted images can be managed via the Set Cell Background Image toolbar button or the Cell Style Properties dialog.
type: Determines how paths are interpreted.
Images are drawn immediately after formula evaluation is complete.
=imageIf(P251 > 0, "e:\image_file1.png", "e:\image_file2.png", 1)
=imageIf(S10:S120 = 0, "folder1\music_file1.jpg", "image_file2.gif", 0)
messageIf(message, type, if_condition, reference-as-text)
Displays a message box with OK and Cancel.
message: Text to display.
type:
- 1 — information icon
- 2 — warning icon
- 3 — question icon
if_condition:
Message appears only if the condition evaluates to non‑zero.
reference (as text):
Optional full worksheet path.
If provided and you click OK, GS-Calc jumps to the referenced cell/range.
Messages appear immediately after formula evaluation is complete. You can use if_condition = 1 to signal the end of updating.
=messageIf("need to inspect this cell", 1, isError(folder2\sheet2!P251), "folder2\sheet2!P251")
=messageIf("need to inspect this cells", 1, isError(S120), "S121:S200")
playSoundIf(path, type, if_condition, loops, volume)
Plays MP3 and WAV files.
path:
File path.
- If type = 1: external disk file (e.g., e:\music_file1.mp3).
- If type = 0: full worksheet path of a file inserted via Insert > File.
type: Determines how the path is interpreted.
if_condition: File plays only if non‑zero.
loops:
Number of times to play.
-1 = endless loop.
volume:
Value from 0 to 1000.
Files play immediately after formula evaluation is complete. Use if_condition = 1 to signal the end of updating.
If multiple files are queued, they play sequentially.
To stop playback, press ESC or use Tools > Cancel Update.
=playSoundIf("e:\music_file1.mp3", 1, true, 1, 40)
=playSoundIf("folder1\music_file1.mp3", 0, true, 100, 80)
setFormatIf(reference, action, if_condition, format_true, format_false)
This function formats a cell or range of cells. The numeric action parameter specifies which formatting attributes to set or clear (restore defaults).
It is often convenient to keep formatting formulas in a separate worksheet so a single control cell can affect formatting across multiple sheets.
The function works on both existing cells and empty regions. There are no limits on the number or complexity of conditional formatting operations — millions of cells may be formatted using nested IFs or other formulas.
Formatting Layers
If reference specifies entire columns or rows, formatting applies to column or row styles. Formatting precedence:
table style < column styles < row styles < cell styles
Cell styles override all other styles.
format_true / format_false Values
Values may be -1 (restore default) or one of the following:
- 1 — numeric style (index or name)
- 2 — custom style pattern (e.g., $#,##0.00)
- 3 — font size (4–256)
- 4 — font name
- 6 — bold (0/1)
- 7 — italic (0/1)
- 8 — underline (0/1)
- 9 — strikeout (0/1)
- 11 — font color (RGB value, “#RRGGBB”, or color name)
- 14 — horizontal alignment (0 left, 1 center, 2 right)
- 15 — vertical alignment (0 top, 1 center, 2 bottom)
- 16 — wrap text (0/1)
- 17 — horizontal indent (0–64 px)
- 18 — vertical indent (0–64 px)
- 19 — text rotation (−180 to 180 degrees)
- 20 — cell borders (“position width style color”)
- 21 — borders around selection (“width style color”)
- 22 — background color (RGB value, “#RRGGBB”, or color name)
- 25 — print / don’t print (0/1)
- 26 — hyperlink (0/1)
- 27 — filter cell (0/1)
- 28 — image list cell (0/1)
- 29 — area in‑cell chart (0/1)
- 30 — column in‑cell chart (0/1)
- 31 — bar in‑cell chart (0/1)
- 32 — apply all attributes at once using a named custom style
Custom Cell Styles
action = 32 applies all formatting attributes using a named custom style. Custom styles are created in Format > Custom Cell Styles and saved in the workbook.
They may also be saved to or loaded from the global GS-Calc cache using:
- Save As Default App Styles
- Load Default App Styles
Border Formatting (action = 20)
position may include:
- top
- left
- bottom
- right
- diag-left
- diag-right
width may be:
- thin, medium, thick
- numeric values with px, pt, in, mm, cm, pc
style may be:
- solid
- dotted
- dash
- long-dash
- dot-dash
- dot-dot-dash
- wave
- double
color may be an RGB value, “#RRGGBB”, or one of:
- black
- maroon
- green
- olive
- navy
- purple
- teal
- gray
- silver
- red
- lime
- yellow
- blue
- fuchsia
- aqua
- white
Return Value
The function returns the evaluated value of if_condition.
=setFormatIf(c120, 11, c120 > 0, "green", "red")
=setFormatIf(c:e, 11, c120 > 0, "green", "red")
=setFormatIf(10:20, 11, c120 > 0, "green", "red")
=setFormatIf(c120, 20, c120 > 0, "all 2px solid green", "diag-left diag-right red")
=setFormatIf(d100:d999, 1, c1="use format", "currency", 0)
=setFormatIf(d99, 20, a1, "bottom 2px dotted green", -1)
=setFormatIf(d99, 32, a10 > 10, "my-style-1", "my-style-2")