Planarly provides a full set of logical operators for testing table values and performing logical cell-wise operations between tables. It also provides IfElse() and Where for the conditional evaluation of formulas based on table contents.

IfElse(if1, then1, if2, then2, ..., else)

IfElse takes one or more if/then (value/response) pairs and an else response. Each if/then pair is evaluated in turn. If the if, which may be a single 1x1 value or an expression that returns a single 1x1 value, evaluates to True the associated then is returned. If a True value is not encountered, the else response is returned.

IfElse() evaluates if/then pairs in order and stops as soon as a True value has been found. Below is an example where it is the middle pair that evaluates to True. It uses relative index operators to specify values, which you can learn about in the Single Sheet tutorial or the Referencing section.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5bcf1b5c-501f-4103-aa3d-54c23fb20e61/Screenshot_2021-06-01_at_16.52.40.png

IfError(if, then, else)

IfError takes one if/then (value/response) pairs and an else response. If the if, which may be a single cell with error message or an expression that returns an error message, the associated then is returned. If error message is not encountered, the else response is returned.

IsError(if)

IfError takes one if only. If the if, which may be a single cell with error message or an expression that returns an error message, returns True any other value will return False

Where(where1, then1, where2, then2, ..., else)

Where() allows you to conditionally return values based on the contents of one or more tables. Like IfElse() above, it takes any number of value/result pairs. Unlike IfElse(), Where() accepts arbitrary tables in the value (where) parameters with the additional condition that all parameters have the same dimensions.

The where parameters must contain only boolean values. In the examples below a combination of logic and mathematical operators are used to transform the contents of table a at the top of the sheet into table of booleans. The then and else arguments are then used to return appropriate values. In these simple examples Where() is used like a simplified table comprehension, which you can read more about here.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b4d95f3f-800f-4ec0-a536-f35e6d7e16fa/Screenshot_2021-06-03_at_11.03.11.png

But Where() can be used with multiple tables to combine results based on the criteria of your choosing. Below we use some simple substitution, but as in the middle example of the above screenshot, arbitrary calculations can be performed.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d21b9089-eda3-41d6-91c9-f1adce1fbdd4/Screenshot_2021-06-03_at_11.44.27.png

Not(#a)