Skip to main content

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:

ConstantSyntaxValue
PiPI()3.14159265358979...
Euler's numberE()2.71828182845905...
circumference = PI() * 2 * r
growth = P * E()^(k * t)

Physical constants

ConstantSyntaxValueDescription
Standard gravity1 g9.80665 m/s²Acceleration due to gravity
weight = 100 kg * 1 g        // → force from mass

Boolean values

Logical functions return dimensionless numbers:

ValueRepresentation
TRUE1 (any non-zero value)
FALSE0
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 labels
  • VLOOKUP(name, ...) — looking up named entries
  • CONCAT(...) — joining text
  • TEXT(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):

OperationExampleWhy dimensionless
Ratiofb / FbStress ÷ stress cancels
CountCOUNT($A1:$A10)Pure number
Angle45 degAngles are dimensionless
ComparisonL > 10 ftBoolean (0 or 1)
TrigSIN(30 deg)Ratio

Next steps