Built-in functions
Blockpad has hundreds of built-in functions, ranging from basic functions like Sqrt() to those made specifically for engineering, like VlookupInterpolate().
This deep dive page is not an exhaustive list of all Blockpad functions, but it gives an overview of commonly used functions and an idea of how to use them.
The majority of Blockpad functions are made to work like conventional spreadsheet functions, e.g. If(), Vlookup(), AverageIf(), or Concat(). For these functions, you can typically reference the large amount of online content covering how best to work with them, in addition to Blockpad documentation.
Blockpad also makes it easy to define your own custom functions. Learn more in the calculations section of the deep dive.
Functions as library items
Blockpad functions are stored in different libraries that are included in the program by default. You can view the libraries, and see all of the functions they contain, on the Blockpad library page under the Built-in section.

Further documentation on each function can be found on it's respective library page. The link provided in the tables below will take you to the page for that function.
Functions and units
Blockpad functions are built to work with units intelligence. In practice, this means different things for different functions.
For example, Sum() or Average() will automatically convert all inputs to the same output unit, but they need to all be compatible with each other (e.g. ft and m, or psi and MPa).
Other functions will only take specific units as an input. For example, the inputs for Sin() must have angular-compatible units.
The way functions work with units should be intuitive, but you can check the function documentation or the units page for information.
Math
General math functions
Blockpad includes standard math functions like Sqrt(), Log(), and Abs().
Sqrt() | Returns the square root of a value. |
NthRoot() | Returns the nth root of a value. I.e. (value)^(1/n). |
Log() | Returns the log of a number, given a base. |
Log10() | Returns the base 10 log of a number. |
Ln() | Returns the natural log of a number. |
Abs() | Returns the absolute value of a number. |
Exp() | Returns e raised to a given power. |
GCD() | Returns the greatest common denominator of the given numbers. |
LCM() | Returns the least common multiple of the given numbers. |
Modulus() | Returns the remainder after dividing a given number with another given number. |
Math Values
Blockpad includes built-in values. Unlike conventional spreadsheets, they are stored as values, not functions, so there's no need to follow them with parentheses.
pi or π | The value for pi, i.e. 3.14159... |
e | The value for Euler's number, i.e. 2.71828... |
i or j | The imaginary number, i.e. the square root of negative one. |
Trigonometry
Blockpad includes all trigonometric and and hyperbolic functions.
The inputs for trig functions are expected to have an angular unit (rad or deg). If no unit is provided, the input will be interpreted as radians.
The inputs for inverse trig functions are expected to be unitless and in the range acceptable for that function (e.g. between -1 and 1 for acos()). The outputs for inverse trig functions are given as radians, but can be converted to degrees using the to keyword.
Trigonometric functions also work with complex numbers.
Sin() | Returns the sine of an angle. |
Cos() | Returns the cosine of an angle. |
Tan() | Returns the tangent of an angle. |
Asin() | Returns the arcsine of a number as an angle between -pi/2 and pi/2. |
Acos() | Returns the arccosine of a number as an angle between 0 and pi. |
Atan() | Returns the arctangent of a number as an angle between -pi/2 and pi/2. |
Atan2() | Returns the arctangent of given (x, y) coordinates as an angle between -pi and pi, not including -pi. |
Csc() | Returns the cosecant of an angle. |
Sec() | Returns the secant of an angle. |
Cot() | Returns the cotangent of an angle. |
Sinh() | Returns the hyperbolic sine of an angle. |
Cosh() | Returns the hyperbolic cosine of an angle. |
Tanh() | Returns the hyperbolic tangent of an angle. |
Asinh() | Returns the hyperbolic arcsine of a number as an angle between -pi/2 and pi/2. |
Acosh() | Returns the hyperbolic arccosine of a number as an angle between 0 and pi. |
Atanh() | Returns the hyperbolic arctangent of a number as an angle between -pi/2 and pi/2. |
Functions for units
Compatible() | Tests if two numbers have compatible units (e.g. both are lengths) and returns true or talse. Compatible(1ft, 3m) = true |
Magnitude() | Returns the unitless magnitude of a number with units. ***The preferred method for "stripping" units is found on the units page |
Unit() | Returns the units stored with a number. |
UnitConvert() | Converts a number to different units. (e.g. UnitConvert(5 m, 1 in) )The to keyword is typically preferable (e.g. 5 m to in ). |
Rounding functions
Round() | Returns a value rounded to a specified number of digits. |
RoundDown() | Returns a value rounded down to a specified number of digits. |
RoundUp() | Returns a value rounded up to a specified number of digits. |
RoundSigFigs() | Returns a value rounded to the specified number of significant figures. |
Int() | Returns the next integer, moving down towards negative infinity. |
Truncate() | Returns a value with the numbers after the decimal removed (i.e. rounded down to the nearest integer, towards zero). |
Even() | Returns the next even integer, moving away from zero. |
Odd() | Returns the next odd integer, moving away from zero. |
Floor() | Returns the next multiple, moving down towards negative infinity. |
Ceiling() | Returns the next multiple, moving up towards infinity. |
Calculus
Derivative() | Returns the derivative of a function. Derivative(x=>x^2+x) = 2*x + 1
|
Integral() | Returns the definite integral of a function, given start and end points. Integral(x=>2*x+3, 1, 4) = 24
|
The main input for Derivative() and Integral() is a custom function. This function can either be a named custom function, or an inline function directly in the input.
The output for Derivate() is a function that can be used in formulas. Just reference the result, and use it like a normal function.
Also note that the units of the bounds for the Integral() function have an impact on the result, but you must make sure the units of the function all work out.
Interpolation
Interpolate() | Classic interpolation - returns a y value given an x value and pairs of x and y (x1, x2, y1, y2). Interpolate(2.5, 1, 5, 10, 50) = 25
|
VlookupInterpolate() | Returns an interpolated value, given a lookup value, an array or range, and a column index. |
HlookupInterpolate() | Returns an interpolated value, given a lookup value, an array or range, and a row index. |
Interpolate2D() | Returns a value given a row lookup value, a column lookup value, and an array or range. |
Note: VlookupInterpolate() and HlookupInterpolate() are stored in the Lookup library, and not the Math library.
VlookupInterpolate() Example
Interpolate2D() Example
Numerical solving
In addition to solver sections, Blockpad has a GoalSeek() function for finding numerical solutions to single variable functions.
GoalSeek() | Returns the value that when plugged into the given function, yields the desired solution.GoalSeek(x=>x^2+x, 6) = 2
|
The first input for GoalSeek() is a single variable function, which can be either a named custom function or an inline function. The second input is the desired result for that function, and the output is a value of the function variable that would yield that result.
Because GoalSeek() is a numerical solver, it does not provide all solutions to an equation, only one.
Summation
In Blockpad, summation is available as a function, and when it's entered in an equation, it's displayed with typical math notation using the sigma symbol.

The first input to Summation() is a function, typically an in-line function, but named functions work too. The second and third inputs are the start and end, respectively, of the series.

You can create double summations by layering two summation functions, as shown in the example below.

Logic
For the most part, Blockpad logic functions work like conventional spreadsheet logic functions.
You can read more about boolean operations in the Logic and boolean values section of the deep dive.
Basic logic functions
Not() | Returns true if given false, and false if given true.Not(0 > 100) = true Not("A"=="A") = false |
And() | Returns true if all inputs are true, and false if any are false.And(100 > 0, 0 > -100) = true And("A"=="A", "A"=="B") = false |
Or() | Returns true if any inputs are true, and false if none are true.Or(100 < 0, 0 < -100) = false Or("A"=="A", "A"=="B") = true |
Xor() | Returns true if there are an odd number of true inputs.Xor(100 > 0, 0 > -100) = false Xor("A"=="A", "A"=="B") = true |
If()
The Blockpad If() function
works just like the If() function in conventional spreadsheets.
Given a boolean value, it returns one thing if true, and another thing if false.
E.g. If(5>0, "positive", "negative") = "positive"
When used in dynamic equations, the If() function is displayed as a logic table.
When chained If() functions are used, the logic table continues.
E.g. If(condition1, result1, If(condition2, result2, resultIfConditionsNotMet))
These logic tables can be read as "Return A, if X condition is met; Return B if Y condition is met; etc". The example below could be read as "k_c = 1 if loading type is bending; k_c = 0.85 if loading type is axial; etc."
The actual formulas for chained If() functions can get very long. To break them up and make them easier to read, you can use shift+enter in the formula to create a new line.
It can also be helpful to use the visual editor.
Lookup
Blockpad contains most conventional spreadsheet lookup functions, in addition to a few more. These work on arrays and table/spreadsheet ranges. Generally speaking, they will work the same as in other spreadsheet softwares.
The examples below us Table1 and Table2, which are shown here as a table on the web page.
Table1
Name | Height | Width | Depth |
A | 7 in | 4 in | 1 in |
B | 8 in | 5 in | 2 in |
C | 9 in | 6 in | 3 in |
Table2
1 | a | first |
2 | b | second |
3 | c | third |
4 | d | fourth |
5 | e | fifth |
Index() | Returns the value from an array at the given row and column, indexed to 1.Index(Table1, 3, 2) = 8 in Often used with other functions to specify the row and column. Index(Table1, Rows(Table1), Columns(Table1)) = 3 in Index(Table1, Match("B", WholeColumn(Table1, 1)), Match("Width", WholeRow(Table1, 1))) = 5 in |
Match() | Returns the location of a lookup value in a one-dimensional array.Match("B", Table1.A1:A4) = 3 Match("Depth", WholeRow(Table1, 1)) = 4 By default, Match() works the same as MatchLessThan(). If the third input is False, then it will work the same as MatchExact() |
MatchExact() | Returns the location of a lookup value in a one dimensional array. The values must be an exact match. MatchExact("B", WholeColumn(Table1, 1)) = 3 MatchExact(2, WholeColumn(Table2, 1)) = 2 MatchExact(2.5, WholeColumn(Table2, 1)) = error |
MatchLessThan() | Returns the location of a lookup value in a one dimensional array or the next lowest value. The array must be in ascending order. MatchLessThan("B", Table1.A:A) = 3 MatchLessThan(2.5, Table2.A:A) = 2 MatchLessThan(25, Table2.B:B) = error |
MatchGreaterThan() | Returns the location of a lookup value in a one dimensional array or the next highest value. The array must be in descending order. MatchGreaterThan("B", Table1.A:A) = 3 MatchGreaterThan(2.5, Table2.A:A) = error MatchGreaterThan(25, Table2.B:B) = 3 |
Xlookup() | Returns a table value given a lookup value, a one-dimensional lookup array, and a one-dimensional value array. It looks for an exact match by default. Xlookup("C", WholeColumn(Table1, 1), WholeColumn(Table1, 4)) = 3 in Xlookup("Height", Table1.A1:D1, Table1.A3:D3) = 8 in |
Vlookup() | Returns a table value given a lookup value, a lookup table/array, and a column index. The function looks in the first column for the lookup value and returns the corresponding value. Vlookup("B", Table1.A2:B4, 2) = 8 in Vlookup(4, Table2.A1:D5, 3) = "d" By default, it works the same as VlookupApprox(), but if False is given as the fourth input, it works like VlookupExact(). Vlookup(2.9, Table2.A1:D5, 4) = "second" Vlookup(2.9, Table2.A1:D5, 4, false) = error |
VlookupApprox() | Returns a table value given a lookup value, a lookup table/array, and a column index. If an exact match isn't found, the next lowest value available will be used as the lookup value. The lookup column must be in ascending order. VlookupApprox("B", Table1.A2:B4, 2) = 8 in VlookupApprox(2.9, Table2.A1:D5, 4) = "second" VlookupApprox(20, Table2.B1:C5, 2) = error (values not in ascending order) |
VlookupExact() | Returns a table value given a lookup value, a lookup table/array, and a column index. Only an exact match will work, and the values can be in any order. VlookupExact("B", Table1.A2:B4, 2) = 8 in VlookupExact(2.9, Table2.A1:D5, 4) = error VlookupExact(20, Table2.B1:C5, 2) = "d" |
VlookupInterpolate() | Returns an interpolated table value given a lookup value, a lookup table/array, and a column index. If an exact match isn't found, then an interpolated value will be returned using the next lowest and highest values. See also the interpolation section of this page VlookupInterpolate(2.85, Table2.A1:B5, 2) = 31.5 |
Hlookup() | Returns a table value given a lookup value, a lookup table/array, and a row index. The function looks in the first row for the lookup value and returns the corresponding value. By default it works like HlookupApprox(), but if False is given as the fourth input, it works like HlookupExact(). Hlookup("Width", Table1.B1:D4, 2) = 4 in |
HlookupApprox() | Returns a table value given a lookup value, a lookup table/array, and a row index. If an exact match isn't found, the next lowest value available will be used as the lookup value. The lookup row must be in ascending order. |
HlookupExact() | Returns a table value given a lookup value, a lookup table/array, and a row index. Only an exact match will work, and the values can be in any order. |
Text
Blockpad text functions are mostly modeled after conventional spreadsheet text functions, with some different functions available.
Find more on text values in the text values section of the deep dive.
Basic text functions
Concat() | Returns the given text values combined as one text value.Concat("hello", " ", "there") = "hello there" |
Left() | Returns a specified number of characters from the left of a given text value.Left(5, "hello there") = "hello" |
Right() | Returns a specified number of characters from the right of a given text value.Right(5, "hello there") = "there" |
Mid() | Returns a specified number of characters from the middle of a text value, given a starting point.Mid("hello there", 3, 8) = "llo ther" |
Len() | Returns the number of characters in a given text value.Len("hello there") = 11 |
Text() | Returns the given value as text.Text(102.1 lb) = "102.1 lb" |
Value() | Returns a parsed number value from a given text value.Value("102.1 lb") = 102.1 lb |
Trim() | Returns all spaces from a text value except single spaces between characters.Trim(" hello there ") = "hello there" |
Upper() | Returns a given text value in all upper case letters.Upper("Hello there") = "HELLO THERE" |
Lower() | Returns a given text value in all lower case letters.Lower("Hello there") = "hello there" |
More text functions
Replace() | Returns a text value with a given sub-string replaced with a different sub-string.Replace("hello there", " there", ", good morning") = "hello, good morning" |
Find() | Returns the starting location of a text sub-string in a given text value. Case sensitive.Find("hello", "Hello hello there") = 7 |
Search() | Returns the starting location of a text sub-string in a given text value. Not case sensitive.Search("hello", "Hello hello there") = 1 |
TextJoin() | Returns a text value created from a given array, with a delimiter between each item.TextJoin("_", ["Hello", "hello", "there"]) = "Hello_hello_there" |
TextJoin2() | Returns a text value created from a given array, with a different delimiter between columns and rows.TextJoin2("; ", "=", ["A", "B"; "C", "D"]) = "A=B; C=D" |
TextSplit() | Returns a one dimensional array created from splitting a text value at the given delimiter.TextSplit(" ", "Hello hello there") = ["Hello", "hello", "there"] |
TextSplit2() | Returns two dimensional array created from splitting a text value into columns and rows based on the given delimiters.TextSplit2("; ", "=", "A=B; C=D") = ["A", "B"; "C", "D"] |
Unicode() | Returns the unicode value of the first character in a given text value.Unicode("hello there") = 104 |
Char() | Returns the character of a unicode value (given as a unitless number).Char(104) = "h" |
Arrays
In addition to basic math functions that work on arrays, like Max() or Average(), Blockpad has functions for creating and manipulating arrays. Probably the most commonly used of these "advanced" functions are LinearSeries(), Each(), CountAll(), and Where().
Also note that table ranges essentially work the same as arrays, so all of these functions will also work on table ranges.
If a function isn't made for arrays, it will often perform the function item-by-item
on the array.
For example, Sin([0; pi/4; pi/2]) = [0; 0.707; 1]
Basic
Max() | Returns the highest value.Max(A) = 4 |
Min() | Returns the lowest value.Min(A) = 1 |
Sum() | Returns the sum of the values.Sum(A) = 10 |
SumIf() | Returns the sum of the values that meet the given criteria.SumIf(A, >2) = 7 |
SumSq() | Returns the sum of the squares of each value.SumSq(A) = 30 |
Product() | Returns the product of all the values.Product(A) = 24 |
Average() | Returns the average (mean) of the values.Average(A) = 2.5 |
AverageIf() | Returns the average (mean) of the values that meet the given criteria.AverageIf(A, >2) = 3.5 |
Matrix and vector math
In addition to the functions below, regular Blockpad operators +, -, *, /, and ^ default to matrix math interpretations when used with arrays in Blockpad. If a matrix math operation isn't possible (like with mismatching rows and columns), then item-by-item calculations are performed instead.
CrossProduct() | Returns the cross product of two vectors.CrossProduct([1, 2, 1], [1, 0, 1]) = [2, 0, -2] |
DotProduct() | Returns the dot product of two vectors.DotProduct([1, 1, 2], [3, 1, 1]) = 6 |
Determinant() | Returns the determinant of a matrix.Determinant([1, 2, 1; 0, 3, 0; 4, 1, 2]) = -6 |
Inverse() | Returns the inverse of a matrix.Inverse([0,3,2; -1,4,2; 3,-4,-1]) = [-4, 5, 2; -5, 6, 2; 8, -9, -3] ^-1 also works for this purpose, e.g. Inv = A^-1 , where A is a matrix.
|
Creating arrays
LinearSeries() | Returns a one dimensional array, given a start value, end value, and step size.LinearSeries(1, 4) = [1; 2; 3; 4] LinearSeries(0 in, 1.5 in, 0.5 in) = [0 in; 0.5 in; 1 in; 1.5 in] |
MakeArray() | Returns an array of null values, given the number of rows and columns.MakeArray(2, 3) = [-, -, -; -, -, -] The optional 3rd input is an in-line function of row and column indices (indexed to zero). MakeArray(3, 1, i => 5) = [5; 5; 5] MakeArray(2, 2, (i, j) => Sqrt(i^2 + j^2)) = [0, 1; 1, 1.414] |
Zeros() | Returns an array of zero values, given the number of rows and columns.Zeros(2, 3) = [0, 0, 0; 0, 0, 0] |
Identity() | Returns an identity matrix of a given size.Identity(3) = [1, 0, 0; 0, 1, 0; 0, 0, 1] |
Information
CountAll() | Returns the number of items in an array.CountAll(MakeArray(2, 3)) = 6 |
Rows() | Returns the number of rows in an array.Rows(MakeArray(2, 3)) = 2 |
Columns() | Returns the number of columns in an array.Columns(MakeArray(2, 3)) = 3 |
CountIf() | Returns the number of items in an array that meet the given criteriaCountIf([1, 2; 3, 4], ==4) = 1 CountIf([1, 2; 3, 4], a => 1 < a < 4) = 2 |
Any() | Returns true if any items in an array meet the given criteria, false otherwise.Any([1, 2; 3, 4], == 3) = True Any([1, 2; 3, 4], a => a^2 > 25) = False If no second input is given, it returns true if any items are in the array, false if not. Any([]) = False |
All() | Returns true if all items in an array meet the given criteria, false otherwise.All([1, 2; 3, 4], < 10) = True All([1, 2; 3, 4], a => 1 < a < 4) = False If no second input is given, it returns true if there are no items in the array, false if there are. All([]) = True |
Adding and removing items
The examples in the following table will use the arrays shown in the image below.

Shown in the image:
A = MakeArray(3, 3, (i, j) => i + j)
B = MakeArray(1, 3, (i, j) => j^2 + 3)
C = MakeArray(3, 1, i => i^2 + 10)
Take() | Returns a sub-array given the rows and columns to "take" from the top left.Take(A, 1, 2) = [0, 1] You can use negative numbers to "take" from the bottom right. Take(A, -2, -2) = [2, 3; 3, 4]
|
Drop() | Returns a sub-array given the rows and columns to "drop" from the top leftDrop(A, 1, 2) = [3; 4] You can use negative numbers to "drop" from the bottom right. Drop(A, -1, -2) = [0; 1]
|
Range() | Returns a subarray given a start row, end row, start column, and end column, indexed to zeroRange(A, 0, 1) = [0, 1, 2; 1, 2, 3] Range(A, 0, 1, 1, 2) = [1, 2; 2, 3]
|
WholeRow() | Returns a row from an array, indexed to 1.WholeRow(A, 1) = [0, 1, 2] |
WholeColumn() | Returns a column from an array, indexed to 1.WholeColumn(A, 2) = [1; 2; 3] |
ConcatItems() | Returns a one dimensional array of all the items in the given arrays, read left to right, top to bottom.ConcatItems(A, B) = [0; 1; 2; 1; ... 3; 4; 7] |
ConcatRows() | Returns an array that combines the rows in the given arrays (i.e. stacks vertically).ConcatRows(A, B) = [0, 1, 2; 1, ... 4; 3, 4, 7] |
ConcatColumns() | Returns an array that combines the columns in the given arrays [i.e. stacks on to the right side]ConcatColumns(A, C) = [0, 1, 2, 10; ... 2, 3, 4, 14] |
Sorting and filtering
The examples in the following table will use the arrays shown in the image below.

Shown in the image:
A = LinearSeries(0 kg, 100 kg, 5 kg)
B = MakeArray(4, 4, (i, j) => Max(i^2, j^2))
Where() | Returns a single dimensional array of the values that meet the criteria function.Where(A, <= 15 kg) = [0 kg; 5 kg; 10 kg; 15kg Where(A, mass => 75 kg < mass < 100 kg) = [80 kg; 85 kg; 90 kg; 95 kg]
|
First() | Returns the first value from an array that meets the criteria function.First(A) = 0 kg First(A, >52 kg) = 55 kg
|
Last() | Returns the last value from an array that meets the criteria function.Last(A) = 100 kg Last(A, < 83 kg) = 80 kg
|
UniqueItems() | Returns a one-dimensional array that containes all of the unique items in a given array.UniqueItems(B) = [0, 1, 4, 9] |
Transpose() | Returns an array with flipped rows and column indices from a given array.Transpose([1; 2; 3; 4]) = [1, 2, 3, 4] Transpose([1, 2, 3; 4, 5, 6]) = [1, 4; 2, 5; 3, 6] |
Mapping

Shown in the image:
A = [1, 2; 3, 4; 5, 6]
B = [2, 4, 6; 8, 10, 12]
Each() | Performs the given function on each item in an array, and returns an array of the results.Each([2 m; 5 m; 10 m], L => L^2) = [4 m^2; 25 m^2; 100 m^2] Each([1, 2, 3; 4, 5, 6], x => 2*x) = [2, 4, 6; 8, 10, 12]
|
EachRow() | Performs the given function on each row of an array, and returns a one dimensional array of the results.
The variable in the function is the row, as an array.EachRow(A, row => Max(row)) = [2; 4; 6] EachRow(A, r => Sum(r)) = [3; 7; 11] You can also specify multiple variables in the function, and they will be treated as the 1st, 2nd, etc items in the row. EachRow(A, (x, y) => x^2 + y^2) = [5; 25; 61]
|
EachColumn() | Performs the given function on each column of an array, and returns a one dimensional array of the results.
The variable of the function is the column, as an array.EachColumn(B, col => Average(col)) = [5, 7, 9] EachColumn(B, c => SumSq(c)) = [68, 116, 180] You can also specify multiple variables in the function, and they will be treated as the 1st, 2nd, etc items in the column. EachColumn(B, (a, b) => a^2 + b) = [12, 26, 48]
|
Date/Time
Date/time values represent a date and time of day, and the functions below are for working with that value type.
Date/time values can be shown differently using value formatting. You can also perform arithmetic with date/time values and number values with time units.
Date() | Returns a date time value, given year, month, and dayDate(2022, 2, 13) = 2022.02.13 Note that this is the same as just typing the date/time value in directly, e.g. Day_1 = 2022.02.13 |
DateValue() | Returns a date value, given a text value that can be read as a date.DateValue("Jan 2, 2022") = 2022.01.02 DateValue("01-02-2022") = 2022.01.02 DateValue("2 January 2022") = 2022.01.02 |
Time() | Returns a number value with hr-min-sec units, given the hour, minute, and second.Time(9, 2, 30) = 9 hr 2 min 30 sec Note that this is the same as typing it in as a combination unit, e.g. Time_1 = 9 hr 2 min 30 sec |
Today() | Returns a date/time value of the current day. It will change everytime formulas are updated or the file is opened. Today() = 2022.02.13 |
Now() | Returns a date/time value of the current day at the current time. It will change everytime formulas are updated or the file is opened. Now() = 2022.02.13.13.33.26.791 |
Weekday() | Returns a number representing the day of the week the given date is on. 1: Sunday, 2: Monday, ... 7: Saturday Weekday(2022.02.13) = 1 Weekday(2022.02.16) = 4 |
Complex numbers
See also the complex number section of the deep dive.
Complex() | Returns a complex number given a real component and an imaginary component.Complex(3, 4) = 3 + 4i Note that this is the same as entering an imaginary number directly. |
Argument() | Returns the argument, or "angle", of a complex number as a unitless value. The value can be converted to radians or degrees. Argument(3 + 4i) = 0.927 Argument(Sqrt(3) + i) to deg = 30 deg |
Abs() | When used on a complex number, Abs() returns the magnitude.Abs(3 + 4i) = 5 Abs(Sqrt(3) + i) = 2 |
Polar() | Returns a complex number given a magnitude and an angle (as unitless, radians, or degrees).Polar(2, 30 deg) = 1.732 + i |
Real() | Returns the real component of a complex number.Real(Sqrt(3) + i) = 1.732 |
Imaginary() | Returns the imaginary component of complex number.Imaginary(Sqrt(3) + i) = 1 |
Information
Value information
IsBlank() | Returns true if a null value, false otherwise (an empty cell contains a null value).IsBlank(null) = True IsBlank(0) = False |
IsError() | Returns true if an error, false otherwise.IsError(5 m) = False IsError(5 m + 5 kN) = True |
IsNumber() | Returns true if a number value (with or without units), false otherwise.IsNumber(5 m) = True IsNumber("This is text") = False |
IsNonText() | Returns true if not a text value, false otherwise.IsNonText("This is text") = False Not(IsNonText("This is text")) = True IsNonText(5 m) = True |
IsLogical() | Returns true if a boolean value (true or false), false otherwise.IsLogical(False) = True IsLogical(5 m) = False |
IsDateTime() | Returns true if a date value, false otherwise.IsDateTime(2025.02.12) = True IsDateTime(2 week) = False IsDateTime(2025.02.12 + 2 week) = True |
IsEven() | Returns true if the integer part of a number value is even, false otherwise. (Anything after the decimal is truncated.) IsEven(100 mm) = True IsEven(100.1111 mm) = True IsEven(100 mm to in) = False IsEven(3 mm) = False |
IsOdd() | Returns true if the integer part of a number value is odd, false otherwise. (Anything after the decimal is truncated.) IsOdd(111 mm) = True IsOdd(111.222 mm) = True IsOdd(111 mm to in) = False IsOdd(100 mm) = False |
Table of Contents
-
- Start a new document
- Dynamic equations
- Unit tracking
- Value names
- Reference unnamed values
- Text values
- Other value types
- Referencing a value
- Value name rules
- Names used multiple times
- Renaming and auto-updated references
- Built in values
- Visual editor
- Math layout options
- Show steps and more
- Value formatting
- Spreadsheet in a file
- Sort and filter
- Conditional formatting
- Blockpad specific features
- Open a CSV file
- Mini-spreadsheets in a document
- Reports in a file
- Reference values from other reports in a file
- Header and footer
- Misc. document formatting
- Start a drawing
- Drawing objects
- Lines, points, and shapes
- Text labels
- Linear dimension labels
- Textboxes
- Images
- Selecting multiple objects
- Ordering objects
- Using the point snapping
- Points you can snap to
- Horizontal and vertical from points
- Parallel or perpendicular lines
- Point snap options
- Transformations - resizing and moving
- Format drawings
- Keyboard input and canvas scales
- Top level frames
- Frames in Frames
- Value containers and location
- Frames and sections are containers
- Containers inside containers
- Dot notation to specify a value in a container
- Capture values
- What is a block?
- Block example
- Use the block results
- Block inputs
- View block as table
- Block instances and block definitions
- More examples
- Create a block
- When to make a block
- Make a block with Blockpad calculations
- Update a block definition
- Create a block using scripts
- Block tables
- Examples library
- Use library items in a document
- Use the long form library item name
- Assign a shortcut name to the library
- Include a library in a file
- Use a library number value
- Use a library function
- Use items in a library frame
- Use a library data table as function
- Use library blocks
- Core, built-in, and subscription libraries
- Create personal libraries
- Save items to your library
- Manage your library online
- Library subscriptions
- Console basics
- Read values from the console
- Overwrite values from the console
- Use read and write to manipulate values
- Assign units to numbers in a cell range
- Stemscript basics for scripts
- Macros
- Macros
- Module functions
- Accessing Blockpad
- Using the app
- The online environment
- The desktop environment
- Program updates
- Licensing
- Company management
- Functions as library items
- Functions and units
- Math functions
- Basic math functions
- Math Values
- Trigonometry
- Functions for units
- Rounding functions
- Calculus
- Interpolation
- Numerical solving
- Logic functions
- Lookup
- Text
- Arrays
- Basic array functions
- Matrix math
- Creating arrays
- Information
- Adding and removing items
- Sorting and filtering
- Mapping
- Date/Time
- Complex numbers
- Information