Python Operators#

The table below shows what built-in Python operators correspond to in Excel when excelbird objects are used in arithmetic python expressions, i.e. product = my_row * my_col. These rules apply for any excelbird object that can handle expressions - Cell, Col/Row, Frame/VFrame

Excelbird tries to mimic Excel syntax wherever possible, but in a handful of cases this cannot be done. The most common example is the array range operator, :. Where in Excel you’d use a:b, in excelbird use a >> b

The following are the same in excelbird and Excel

Python

Excel

a > b

a > b

a >= b

a >= b

a + b

a + b

a & b

a & b

a - b

a - b

a * b

a * b

a / b

a / b

a ^ b

a ^ b


The following are all different in excelbird and Excel

Python

Excel

a >> b

a : b

a == b

a = b

a != b

a <> b

a ** b

a ^ b

a | b

OR(a, b)

a % b

MOD(a, b)

a % a

a%

Notice same object is on each sides

~ a

NOT(a)


Built-in python functions work as well. Note: For sum(), you must place your element(s) inside a list, even if there is only one.

Python

Excel

sum(a)

N/A

Don’t do this. Pass list instead

sum([a])

SUM(a)

sum([a, b])

SUM(a, b)

round(a, 2)

ROUND(a, 2)

abs(a)

ABS(a)

math.trunc(a)

TRUNC(a)

math.floor(a)

FLOOR(a, 1)

Excel’s floor takes extra param.

math.ceil(a)

CEILING(a, 1)

Excel’s ceiling takes extra param.