Special Values and Errors
EngCanvas includes mathematical constants, special units, and a set of error types that help you diagnose formula problems.
Mathematical constants
Access constants as zero-argument functions:
| Constant | Syntax | Value |
|---|---|---|
| Pi | PI() | 3.14159265358979... |
| Euler's number | E() | 2.71828182845905... |
circumference = PI() * 2 * r
growth = P * E()^(k * t)
Physical constants
| Constant | Syntax | Value | Description |
|---|---|---|---|
| Standard gravity | 1 g | 9.80665 m/s² | Acceleration due to gravity |
weight = 100 kg * 1 g // → force from mass
Boolean values
Logical functions return dimensionless numbers:
| Value | Representation |
|---|---|
| TRUE | 1 (any non-zero value) |
| FALSE | 0 |
IF(1, "yes", "no") // → "yes"
IF(0, "yes", "no") // → "no"
AND(1, 1) // → 1 (TRUE)
OR(0, 0) // → 0 (FALSE)
Strings
Strings are enclosed in single or double quotes:
label = 'W14x22'
grade = "A992"
Strings are used primarily with:
IF(condition, "OK", "NG")— conditional labelsVLOOKUP(name, ...)— looking up named entriesCONCAT(...)— joining textTEXT(value, format)— formatting numbers
Error types
When a formula can't be evaluated, EngCanvas displays an error. Common errors include:
Dimension mismatch
Raised when you add or subtract quantities with incompatible dimensions:
10 ft + 5 kip // Error: cannot add length and force
Fix: ensure both sides have the same physical dimension.
Unknown unit
Raised when a unit identifier isn't in the registry:
10 xyz // Error: Unknown unit: xyz
Fix: check the unit list for supported units. Common mistakes: g (gram) should be gm, lbm should be lb_m.
Division by zero
10 kip / 0 // Error: division by zero
Unknown variable
Raised when a formula references a variable that hasn't been defined:
result = x * 2 // Error if x is not defined
Fix: define the variable in an earlier cell or box, or check for typos.
Unclosed string
label = 'hello // Error: missing closing quote
Unexpected character
10 ft @ 5 // Error: unexpected character @
Error handling functions
Use these functions to gracefully handle errors in your formulas:
IFERROR
Returns a fallback value if the expression errors:
safe = IFERROR($A1 / $B1, 0)
If $B1 is zero, safe evaluates to 0 instead of raising an error.
IFNA
Returns a fallback value specifically for #N/A errors (e.g., failed VLOOKUP):
result = IFNA(VLOOKUP(key, $A1:$C10, 2, 0), "Not found")
ISERROR / ISNA
Test whether a value is an error:
IF(ISERROR($A1 / $B1), "Error", $A1 / $B1)
ISNUMBER / ISTEXT / ISBLANK
Test the type of a value:
ISNUMBER(10 ft) // → 1 (TRUE)
ISTEXT("hello") // → 1 (TRUE)
ISBLANK($A1) // → 1 if A1 is empty
Dimensionless results
Some operations produce dimensionless values (no unit):
| Operation | Example | Why dimensionless |
|---|---|---|
| Ratio | fb / Fb | Stress ÷ stress cancels |
| Count | COUNT($A1:$A10) | Pure number |
| Angle | 45 deg | Angles are dimensionless |
| Comparison | L > 10 ft | Boolean (0 or 1) |
| Trig | SIN(30 deg) | Ratio |
Next steps
- Operators — arithmetic and comparison operators
- Formula Syntax — complete formula guide