Skip to content

Excel functions

gcvfi edited this page Apr 22, 2020 · 10 revisions

Back to AIQ Commands | Home


Note: Draft content, work in progress, not yet reviewed or verified.


Excel Functions

Syntax

_xl{ "excel formula" } as [variable_name]
_var{ "excel formula" } as [variable_name]

Summing up numbers

_xl{ ${var1} + ${var1} } as sum1 
_xl{ SUM( ${var1}, ${var1} ) } as sum2 

Difference

_xl{ ${sum} - ${var3} } 

Multiplication

_xl{ 17 * 3 } as var_float 

Division

_xl{ 17 / 3 } as var_float 

Round

_xl{ ROUND( ${var_float}, 1 ) } as var_float_round 

Greater than

_xl{ ${table_count} < 20 } as condition 

Dates

_xl{ TEXT( TODAY(), "mm/dd/yyyy" ) } as var_date
_xl{ TEXT( TODAY(), "mmm-ddd" ) } as var_date2
_xl{ TEXT( TODAY(), "mmmm dddd" ) } as var_date3
_xl{ TEXT( DATE( 2020, 1, 20 ), "yyyy-mm-dd" ) } as var_date4

Days between Dates

_xl{ DAYS( DATE( 2020, 2, 20 ), DATE( 2020, 1, 20 ) ) } as date_diff

Excel functions with numbers

_xl{ "$" & SUM( "$18", "$12" ) } as var_sum
_xl{ CEILING( ${var_float}, 1 ) } as var_float_ceil
_xl{ FLOOR( ${var_float} ) } as var_float_floor
_xl{ MAXA( "1", "2", "3", "4", "5" ) } as var_max
_xl{ SMALL( [ "1", "2", "3", "4", "5" ], 3 ) } as var_small

Excel functions with string

_xl{ TRIM( "      string with space       " ) } as var_str_trim
_xl{ LEFT("abcd", 2) } as var_left
_xl{ RIGHT("abcd", 2) } as var_right
_xl{ LEN("abcd") } as var_len
_xl{ FIND("y", "xyz") } as var_pos
_xl{ REPT("abcd", 4) } as var_rept
_xl{ SUBSTITUTE( "test test", "test", "testing" ) } as var_str_sub
_xl{ SPLIT( "111-222-333", "-" ) } as var_str_split
_xl{ REGEXMATCH( "https://test.com?params=testing", "https://test.com?" ) } as var_str_regex_match
_xl{ REGEXREPLACE( "test1 test2 test test", "test[0-9]", "test_with_number" ) } as var_str_regex_replace

Other Examples

See also

Clone this wiki locally