| Function | Signature | Description |
|---|---|---|
AGE |
AGE(date, as_of) → integer |
Completed years from date to as_of (optional, default today) — a birthday age |
DATE |
DATE(year, month, day) → date |
Build a date from year, month and day (day optional, default the 1st; out-of-range months and days roll over). DATE(x) is the calendar day of a date-time or date text |
DATEADD |
DATEADD(date, amount, unit) → date or datetime |
Add an amount to a date or date-time; unit optional (default days). Months, quarters and years keep the day where possible (Jan 31 + 1 month = Feb 29); a date-time keeps its time of day A date-time stays a date-time; a date stays a date unless a clock amount (hours, minutes, seconds) is added. DATEPARSE gives a date-time when its format has clock fields (HH:mm). unit: days | weeks | months | quarters | years | hours | minutes | seconds |
DATEDIFF |
DATEDIFF(start_date, end_date, unit) → integer or decimal |
end_date − start_date in a unit (optional, default days; signed). Days between dates are whole; with a date-time they are elapsed. Weeks, months, quarters and years count completed periods; hours, minutes and seconds are exact Whole days between dates and completed weeks, months, quarters and years are integers; elapsed amounts are decimals. unit: days | weeks | months | quarters | years | hours | minutes | seconds |
DATEFORMAT |
DATEFORMAT(date, format) → string |
Format a date or date-time as text (format optional, default yyyy-MM-dd) |
DATETIME |
DATETIME(date_or_year, time_or_month, day, hour, minute, second) → datetime |
A date-time: DATETIME(date, time), DATETIME(year, month, day[, hour, minute, second]), or DATETIME(x) for a date (midnight), date-time or text. Read on the document zone's clock |
DATETRUNC |
DATETRUNC(date, unit, week_start) → date or datetime |
Start of the period holding a date: year, quarter, month, week (week_start optional, default Monday), isoweek, day → a date; hour, minute, second keep a date-time A date-time stays a date-time; a date stays a date unless a clock amount (hours, minutes, seconds) is added. DATEPARSE gives a date-time when its format has clock fields (HH:mm). unit: year | quarter | month | week | isoweek | day | hour | minute | second week_start: mon | sun | sat |
DAY |
DAY(date) → integer |
Day of the month (1–31) |
DAYNAME |
DAYNAME(date, style) → string |
Name of the weekday ("Monday"; style "short" gives "Mon") style: long | short |
DAYOFYEAR |
DAYOFYEAR(date) → integer |
Day of the year (1–366) |
DAYS |
DAYS(end_date, start_date) → integer |
Calendar days from start_date to end_date (end − start). Excel's order: end first |
DAYS360 |
DAYS360(start_date, end_date) → integer |
Days between dates using 30-day months (US 30/360) |
DAYSINMONTH |
DAYSINMONTH(date) → integer |
Number of days in the date's month (28–31) |
DAYS_AGO |
DAYS_AGO(date) → integer or decimal |
Days before today: whole days for a date, elapsed days for a date-time Whole days between dates and completed weeks, months, quarters and years are integers; elapsed amounts are decimals. |
DURATION |
DURATION(amount, unit) → duration |
A duration: DURATION(90, "minutes"), DURATION(hours, minutes, seconds), or DURATION(text) — "1h 30m", "3 days 04:05:06", "PT1H30M". A month is 30 days, a year 365.25 unit: seconds | minutes | hours | days | weeks | months | years |
DURATION_IN |
DURATION_IN(duration, unit) → decimal |
A duration as a number of units — DURATION_IN(worked, "hours") * rate unit: seconds | minutes | hours | days | weeks | months | years |
EDATE |
EDATE(date, months) → date or datetime |
Add N calendar months to a date; a date-time keeps its time of day A date-time stays a date-time; a date stays a date unless a clock amount (hours, minutes, seconds) is added. DATEPARSE gives a date-time when its format has clock fields (HH:mm). |
ENDOFQUARTER |
ENDOFQUARTER(date) → date |
Last day of the quarter for a date |
ENDOFWEEK |
ENDOFWEEK(date, week_start) → date |
Last day of the week for a date (weeks start Monday unless week_start is given) week_start: mon | sun | sat |
ENDOFYEAR |
ENDOFYEAR(date) → date |
Last day of the year for a date |
EOMONTH |
EOMONTH(date, months) → date |
Last day of the month N months from a date |
FISCALQUARTER |
FISCALQUARTER(date, start_month) → integer |
Fiscal quarter (1–4) for a fiscal year starting in start_month (optional: the document's Fiscal year starts setting) |
FISCALYEAR |
FISCALYEAR(date, start_month) → integer |
Fiscal year, named by the year it ends in (FY2026 starts Oct 1, 2025 when start_month is 10). start_month optional: the document's Fiscal year starts setting |
FROMUNIX |
FROMUNIX(number, unit) → datetime |
Date-time from a Unix timestamp (seconds since 1970 UTC; unit optional: ms, us, ns) unit: s | ms | us | ns |
HOUR |
HOUR(datetime) → integer |
Hour (0–23) of a date-time or time; 0 for a date |
ISDATE |
ISDATE(value) → boolean ALL |
True for a date or date-time, or text that reads as one ("2024-03-15"); false for blank, errors, times and durations. Several values → all of them; ANY(ISDATE(a, b)) for any |
ISOWEEK |
ISOWEEK(date) → integer |
ISO 8601 week number (1–53; weeks start Monday, week 1 holds the year's first Thursday). Pair with ISOYEAR |
ISOYEAR |
ISOYEAR(date) → integer |
Year an ISO week belongs to (Dec 30, 2024 is in ISO year 2025) |
ISWEEKEND |
ISWEEKEND(date) → boolean ALL |
True for Saturday and Sunday. Several values → all of them; ANY(ISWEEKEND(a, b)) for any |
MILLISECOND |
MILLISECOND(datetime) → integer |
Milliseconds (0–999) of a date-time or time |
MINUTE |
MINUTE(datetime) → integer |
Minute (0–59) of a date-time or time |
MONTH |
MONTH(date) → integer |
Month number (1–12) |
MONTHNAME |
MONTHNAME(date, style) → string |
Name of the month ("January"; style "short" gives "Jan") style: long | short |
NETWORKDAYS |
NETWORKDAYS(start_date, end_date) → integer |
Same as WORKDAYS (Excel's name) |
NOW |
NOW() → datetime |
Return the current date and time |
QUARTER |
QUARTER(date) → integer |
Calendar quarter (1–4) |
SECOND |
SECOND(datetime) → integer |
Whole seconds (0–59) of a date-time or time; MILLISECOND has the fraction |
SET_TZOFFSET |
SET_TZOFFSET(datetime, offset) → datetime |
The same clock time as if it had been written with another offset: 10:00 written as CDT, set to +01:00, is 10:00 at +01:00 (09:00 UTC). Not the same as adding a duration. offset is a duration, hours, or anything TZOFFSET reads (GMT+1, EDT, Europe/Paris — a region takes its offset on that date) |
STARTOFFISCALQUARTER |
STARTOFFISCALQUARTER(date, start_month) → date |
First day of the fiscal quarter holding a date |
STARTOFFISCALYEAR |
STARTOFFISCALYEAR(date, start_month) → date |
First day of the fiscal year holding a date |
STARTOFMONTH |
STARTOFMONTH(date) → date |
First day of the month for a date |
STARTOFQUARTER |
STARTOFQUARTER(date) → date |
First day of the quarter for a date |
STARTOFWEEK |
STARTOFWEEK(date, week_start) → date |
First day of the week for a date (Monday unless week_start is given) week_start: mon | sun | sat |
STARTOFYEAR |
STARTOFYEAR(date) → date |
First day of the year for a date |
TIME |
TIME(hour_or_value, minute, second) → time |
A time of day: TIME(hour, minute[, second]) (wraps past 24 h, as in Excel), or TIME(x) for the time of a date-time (document zone) or time text |
TODAY |
TODAY() → date |
Return today's date |
TZOFFSET |
TZOFFSET(value, as_of) → duration |
UTC offset as a duration (−12:00 to +14:00). Text: the first offset or zone it states — GMT+5, -05:30, 1.5h, EDT, America/New_York (as_of optional, default today, picks the date for daylight saving). A date-time: the offset it was written with, else the document zone's. A number is hours. Blank when none is found; error when out of range |
UNIX |
UNIX(datetime, unit) → decimal |
Unix timestamp of a date-time (seconds since 1970 UTC; unit optional: ms, us, ns). A date counts from its midnight in the document zone unit: s | ms | us | ns |
WEEKDAY |
WEEKDAY(date, week_start) → integer |
Day of the week, 1 = Monday … 7 = Sunday (ISO). Excel counts from Sunday: WEEKDAY(x, "sun") or WEEKDAY(x, 1) for that week_start: mon | sun | sat |
WEEKNUM |
WEEKNUM(date, week_start) → integer |
Week of the year: week 1 holds Jan 1, weeks start Sunday unless week_start is given (Excel's default). ISOWEEK for ISO weeks week_start: mon | sun | sat |
WORKDAY |
WORKDAY(date, days) → date |
Add N business days to a date |
WORKDAYS |
WORKDAYS(start_date, end_date) → integer |
Weekdays from start_date to end_date, both counted (as Excel's NETWORKDAYS); negative when end is first |
YEAR |
YEAR(date) → integer |
Year of a date |
YEARFRAC |
YEARFRAC(start_date, end_date, basis) → decimal |
Fractional years from start to end (signed). Basis optional: actual days by default (leap years counted); 30/360 and the others only by name basis: actual | 30/360 | 30E/360 | actual/360 | actual/365 |
| Function | Signature | Description |
|---|---|---|
ALL |
ALL(bool, …) → boolean |
True if all arguments are true (logical AND): ALL(ISBLANK(a, b)) |
AND |
AND(bool, …) → boolean |
True if all arguments are true |
ANY |
ANY(bool, …) → boolean |
True if any argument is true (logical OR): ANY(ISVALID(a, b)) |
BLANK |
BLANK() → string |
A blank (empty) value. Also written as the bare word blank or null: IF(ISEVEN(a), "even", blank) |
COALESCE |
COALESCE(value, …) → argument type |
Return the first non-blank value from a list The result has the arguments' common type. |
ERROR |
ERROR(message) → string |
An error value; message optional. Also written as the bare word error: IF(ISVALID(a), a, error) |
FIRST |
FIRST(type, value, …) → named type |
The first non-blank value among the arguments of the given type: any, text, number, date, datetime, time, duration or boolean. Without a type name first, the first non-blank of all the arguments: FIRST(x, "n/a") The result has the type named by the first argument; without a type name, the arguments' common type. type: any | text | number | date | datetime | time | duration | boolean |
IF |
IF(condition, then, else_) → string |
Return one value if a condition is true, another if false |
ISBLANK |
ISBLANK(value) → boolean ANY |
True if a value is blank or empty. Several values → any of them; ALL(ISBLANK(a, b)) for all |
ISCLOSE |
ISCLOSE(tolerance, value, …) → boolean |
True if the values are within tolerance of each other. A number is an absolute tolerance: ISCLOSE(10, a, b) is true for 1,000 and 1,010 (the largest minus the smallest is at most 10). A percentage, written (1%) or from a Percentage column, is relative to the largest magnitude: ISCLOSE(1%, a, b) is true for 1,000 and 1,010, not for 1,000 and 1,011. Blanks equal each other and nothing else, as ISEQUAL; an error stays an error |
ISDATE |
ISDATE(value) → boolean ALL |
True for a date or date-time, or text that reads as one ("2024-03-15"); false for blank, errors, times and durations. Several values → all of them; ANY(ISDATE(a, b)) for any |
ISEQUAL |
ISEQUAL(value, …) → boolean |
True if all values are equal (strings trimmed before comparison). Blanks equal each other and nothing else, so the result is always true or false; an error stays an error |
ISERROR |
ISERROR(value) → boolean ANY |
True if a value is an error. Several values → any of them; ALL(ISERROR(a, b)) for all |
ISEVEN |
ISEVEN(number) → boolean ALL |
True if number is even. Several values → all of them; ANY(ISEVEN(a, b)) for any |
ISNUMBER |
ISNUMBER(value) → boolean ALL |
True for a number, or text that reads as one ("1,200"); false for blank, errors, dates, times, durations and booleans. Several values → all of them; ANY(ISNUMBER(a, b)) for any |
ISODD |
ISODD(number) → boolean ALL |
True if number is odd. Several values → all of them; ANY(ISODD(a, b)) for any |
ISTEXT |
ISTEXT(value) → boolean ALL |
True for non-blank text, including text that reads as a number or date ("12"); false for numbers, dates and blank. Several values → all of them; ANY(ISTEXT(a, b)) for any |
ISVALID |
ISVALID(value) → boolean ALL |
True if a value is neither blank nor an error. Several values → all valid; ANY(ISVALID(a, b)) for any valid |
ISWEEKEND |
ISWEEKEND(date) → boolean ALL |
True for Saturday and Sunday. Several values → all of them; ANY(ISWEEKEND(a, b)) for any |
NOT |
NOT(bool) → boolean |
Negate a boolean value |
OR |
OR(bool, …) → boolean |
True if any argument is true |
VALID |
VALID(value) → argument type |
Return the value if valid, blank otherwise The result has the arguments' common type. |
VALIDATE |
VALIDATE(value, check, result) → boolean |
True when a value is a well-formed identifier of the named kind: VALIDATE(card, "credit_card"). An invalid value is an error saying why; result "bool" makes it false instead, for filters and counts. Blank stays blank. The codes and what they check: Identifier codes in the help check: one of 48 identifier codes (credit_card, ssn, vin, iban, isbn …) — see Identifier codes result: error | bool |
| Function | Signature | Description |
|---|---|---|
ABS |
ABS(number) → decimal or argument type |
Absolute value of a number Date, date-time, time and duration arguments keep their type (the latest of some dates is a date); numbers give a decimal. |
AVG |
AVG(number, …) → decimal or argument type |
Average of a list of numbers Date, date-time, time and duration arguments keep their type (the latest of some dates is a date); numbers give a decimal. |
CEIL |
CEIL(value, step) → decimal or argument type |
Round up to a whole number, or to a step: CEIL(x, 0.05), CEIL(start, 15 min), CEIL(due, "month") (the next period's start; unchanged on a boundary). A date-time alone rounds up to the day Date, date-time, time and duration arguments keep their type (the latest of some dates is a date); numbers give a decimal. |
CLAMP |
CLAMP(number, min, max) → decimal or argument type |
Constrain a value to a min/max range Date, date-time, time and duration arguments keep their type (the latest of some dates is a date); numbers give a decimal. |
COL |
COL(index) → string |
Value of the column at the given 1-based source-file index for the current row |
COUNT |
COUNT(value, …) → integer |
Count the number of non-blank values |
CUMSUM |
CUMSUM({col}) → decimal or duration |
Running sum of a column from the first sorted row through the current row Durations give a duration; numbers give a decimal. |
CUMSUM_GROUP |
CUMSUM_GROUP({col}) → decimal or duration |
Running sum of a column within the current group, resetting at each new group Durations give a duration; numbers give a decimal. |
EXP |
EXP(number) → decimal |
e raised to a power |
FIRSTROW |
FIRSTROW({col}) → column type |
Value of a column on the first row in sort order The result has the column's type. |
FIRST_GROUP |
FIRST_GROUP({col}) → column type |
Value of a column on the first row of the current group in sort order, blank or not (the first row when not grouped) The result has the column's type. |
FLOOR |
FLOOR(value, step) → decimal or argument type |
Round down to a whole number, or to a step: FLOOR(x, 0.05), FLOOR(start, 30 min), FLOOR(day, "month") (the period's start). A date-time alone rounds down to the day. In a list a literal last step applies to each: SUM(FLOOR(a, b, 15 min)) Date, date-time, time and duration arguments keep their type (the latest of some dates is a date); numbers give a decimal. |
GROUP_COUNT |
GROUP_COUNT() → integer |
Number of rows in the current row's group (all rows when not grouped) |
GROUP_TOTAL |
GROUP_TOTAL({col}) → decimal or duration |
Sum of the column's values within the current group (falls back to dataset total when not grouped) Durations give a duration; numbers give a decimal. |
INT |
INT(number) → decimal or argument type |
Round down to a whole number, as Excel: INT(2.7) is 2, INT(-2.5) is -3 (FLOOR(x)). A date-time rounds down to the day. Several in a list: ISEQUAL(INT(a, b, c)) — are they the same whole number? Date, date-time, time and duration arguments keep their type (the latest of some dates is a date); numbers give a decimal. |
ISCLOSE |
ISCLOSE(tolerance, value, …) → boolean |
True if the values are within tolerance of each other. A number is an absolute tolerance: ISCLOSE(10, a, b) is true for 1,000 and 1,010 (the largest minus the smallest is at most 10). A percentage, written (1%) or from a Percentage column, is relative to the largest magnitude: ISCLOSE(1%, a, b) is true for 1,000 and 1,010, not for 1,000 and 1,011. Blanks equal each other and nothing else, as ISEQUAL; an error stays an error |
ISEVEN |
ISEVEN(number) → boolean ALL |
True if number is even. Several values → all of them; ANY(ISEVEN(a, b)) for any |
ISNUMBER |
ISNUMBER(value) → boolean ALL |
True for a number, or text that reads as one ("1,200"); false for blank, errors, dates, times, durations and booleans. Several values → all of them; ANY(ISNUMBER(a, b)) for any |
ISODD |
ISODD(number) → boolean ALL |
True if number is odd. Several values → all of them; ANY(ISODD(a, b)) for any |
LASTROW |
LASTROW({col}) → column type |
Value of a column on the last row in sort order The result has the column's type. |
LAST_GROUP |
LAST_GROUP({col}) → column type |
Value of a column on the last row of the current group in sort order, blank or not (the last row when not grouped) The result has the column's type. |
LN |
LN(number) → decimal |
Natural logarithm (base e) |
LOG |
LOG(number, base) → decimal |
Logarithm with arbitrary base |
MARGIN |
MARGIN(revenue, cost) → percentage |
Gross margin: (revenue − cost) / revenue |
MARKUP |
MARKUP(revenue, cost) → percentage |
Markup over cost: (revenue − cost) / cost |
MAX |
MAX(number, …) → decimal or argument type |
Return the maximum value Date, date-time, time and duration arguments keep their type (the latest of some dates is a date); numbers give a decimal. |
MEDIAN |
MEDIAN(number, …) → decimal or argument type |
Middle value of a set of numbers Date, date-time, time and duration arguments keep their type (the latest of some dates is a date); numbers give a decimal. |
MIN |
MIN(number, …) → decimal or argument type |
Return the minimum value Date, date-time, time and duration arguments keep their type (the latest of some dates is a date); numbers give a decimal. |
MOD |
MOD(number, divisor) → decimal or duration |
Remainder after dividing number by divisor Durations give a duration; numbers give a decimal. |
MODE |
MODE(value, …) → argument type |
Most common value (numbers, dates or text); the smallest on a tie, blank when nothing repeats The result has the arguments' common type. |
MROUND |
MROUND(number, multiple) → decimal or argument type |
Round to nearest multiple Date, date-time, time and duration arguments keep their type (the latest of some dates is a date); numbers give a decimal. |
NEXT |
NEXT({col}) → column type |
Value of another column on the next row in sort order; blank on the last row The result has the column's type. |
NEXT_GROUP |
NEXT_GROUP({col}) → column type |
Like NEXT, but blank on the last row of each group (whole dataset when not grouped) The result has the column's type. |
PERCENTOF |
PERCENTOF(part, total) → decimal |
Percentage of part relative to total (0–100) |
PERCENT_GROUP |
PERCENT_GROUP({col}) → percentage |
Row value as a percentage of the group total (falls back to dataset total when not grouped) |
PERCENT_TOTAL |
PERCENT_TOTAL({col}) → percentage |
Row value as a percentage of the column total across the full dataset |
PERCHANGE |
PERCHANGE(value1, value2) → percentage |
Percent change from value1 to value2: (value2 − value1) / value1 |
POW |
POW(base, exp) → decimal |
Raise a base to an exponent |
PREV |
PREV({col}) → column type |
Value from the previous row in sort order; blank on the first row. PREV() = this column; PREV(col) = another column. Wrap for a fallback: COALESCE(PREV(x), 0) The result has the column's type. |
PREV_GROUP |
PREV_GROUP({col}) → column type |
Like PREV, but blank on the first row of each group (whole dataset when not grouped) The result has the column's type. |
PRODUCT |
PRODUCT(number, …) → decimal |
Multiply a list of numbers |
PROFIT |
PROFIT(revenue, cost) → decimal |
Gross profit: revenue − cost |
PRORATA |
PRORATA({col}, value) → decimal |
Allocates value proportionally: value × (col / TOTAL(col)) |
PRORATA_GROUP |
PRORATA_GROUP({col}, value) → decimal |
Allocates value proportionally within the current group: value × (col / GROUP_TOTAL(col)) |
ROLLUP |
ROLLUP(which, {col}, …) → decimal or argument type |
Pre-computed aggregate for a column: total/sum, avg/mean, min, max, count, median, mode, stdev, distinct, rows, empty, error. Several columns of one type pool their values: ROLLUP("mode", a, b, c) is the most common across all three Date, date-time, time and duration arguments keep their type (the latest of some dates is a date); numbers give a decimal. which: avg | count | distinct | empty | error | max | median | min | mode | rows | stdev | sum | total |
ROUND |
ROUND(number, digits) → decimal |
Round a number to N decimal digits (negative: tens, hundreds); digits optional, default 0 (the nearest whole number). An exact half rounds away from zero, read as the number is written: ROUND(1.005, 2) is 1.01. In a list a literal last digits applies to each: ISEQUAL(ROUND(a, b, 2)) |
ROUNDDOWN |
ROUNDDOWN(number, digits) → decimal |
Round toward zero to N decimal places |
ROUNDUP |
ROUNDUP(number, digits) → decimal |
Round away from zero to N decimal places |
ROW |
ROW() → integer |
1-based position of the current row in sort order |
SIGN |
SIGN(number) → integer |
Return 1, 0, or -1 based on the sign of a number |
SQRT |
SQRT(number) → decimal |
Square root of a number |
STDEV |
STDEV(number, …) → decimal or duration |
Sample standard deviation (÷ n−1) of a set of numbers; blank for fewer than two Durations give a duration; numbers give a decimal. |
SUM |
SUM(number, …) → decimal or duration |
Sum a list of numbers Durations give a duration; numbers give a decimal. |
TOTAL |
TOTAL({col}) → decimal or duration |
Sum of all values in the column across the full dataset Durations give a duration; numbers give a decimal. |
TRUNC |
TRUNC(number, digits) → decimal |
Truncate a number to N decimal digits |
| Function | Signature | Description |
|---|---|---|
ADDRESS |
ADDRESS(source, part) → string |
The first postal address found in text, or one part of it. part optional (default full). state / province / region return a Region, country a Country part: full | street | street1 | street2 | city | locality | state | province | region | postal | zip | postcode | country |
ALPHA |
ALPHA(text) → string |
Extract the first contiguous run of letter characters from text |
AREACODE |
AREACODE(phone) → string |
State or province of a North America area code, from a phone number or a 3-digit code; error when not recognized |
CHAR |
CHAR(code) → string |
Character from a Unicode code point |
CLEAN |
CLEAN(text) → string |
Remove non-printable characters from text |
CODE |
CODE(text, part, n) → string |
An identifier in text, or the label beside it: CODE("ST0414: Prince Albert") is ST0414, CODE(…, "label") is Prince Albert. part optional (default code); n optional: which code (default 1; -1 = last). A code holds a digit; else is ALL CAPS, snake_case or camelCase; else a lowercase slug set off by a delimiter (digital: Digital) part: code | label |
CONCAT |
CONCAT(text, …) → string |
Join two or more text values |
CONTAINS |
CONTAINS(text, search) → boolean |
True if text contains the search string |
CURRENCY |
CURRENCY(value) → string |
ISO 4217 currency code of a money column, a country, or the currency a short text names ("25 usd", "CA$25", "converted to EUR"; a bare $ is the document currency). Blank when none is found |
DATEPARSE |
DATEPARSE(text, format) → date or datetime |
Parse a text string into a date using a format pattern A date-time stays a date-time; a date stays a date unless a clock amount (hours, minutes, seconds) is added. DATEPARSE gives a date-time when its format has clock fields (HH:mm). |
DESLUGIFY |
DESLUGIFY(text) → string |
Convert a slug (hyphens/underscores) into title-case words |
DETECT |
DETECT(source, type, …) → string |
What a text holds. One type: how many (DETECT(notes, "email") → 2). Several: a breakdown ("email:2, phone:0"). None: the types found ("date, email"). Types: address, code, credit_card, date, email, flight, iban, phone, url, uuid type: address | date | email | flight | phone | url |
ENDSWITH |
ENDSWITH(text, suffix) → boolean |
True if text ends with the given suffix |
EXTRACT |
EXTRACT(text, type, n) → string or datetime |
Find an address, date, email, phone number, flight, or url inside longer text, or an identifier VALIDATE knows (vin, iban, credit_card, ssn …: the ones findable in text). n optional: which match (default 1; -1 = last). A date is returned as a date value. An identifier with a distinctive layout (VIN, IBAN, 123-45-6789) is found even when its check digit is wrong, so VALIDATE can check it; a bare run of digits (card, routing, UPC) only when valid Extracting a date gives a date-time; everything else is text. text: address | date | email | phone | flight | url everyday: credit_card | credit_card_masked | ssn | ein | routing_number | phone_e164 | vin | vin_structure | upc | isbn | uuid products: isbn_10 | isbn_13 | issn | ean_13 | ean_8 | sscc banking: iban | swift_bic securities: isin | lei healthcare: npi | dea devices: imei | iccid | container intl: ca_sin | ca_postal | uk_nino | br_cpf | br_cnpj | es_dni | es_nie | cn_resident_id | in_aadhaar |
FIND |
FIND(text, search) → integer |
Position of search string within text (0 if not found) |
GET |
GET(source, part) → string, integer or datetime |
Pull a named component out of a typed value (country, currency, region, email, url, name, address, phone, uuid) or a flight; on a money column, currency:code and currency:name are the currency each amount was recorded in, or out of an identifier VALIDATE knows (vin:model_year, iban:country, credit_card:last4; any checksum token also has :check_digit and :check_digit_expected — see Identifier codes in the help). uuid:time is when a v1, v6 or v7 UUID was made (a Date & Time), uuid:version its version (an integer). A part may be qualified by its type when the name alone is ambiguous: phone:prefix, name:prefix, flight:number uuid:version gives an integer and uuid:time a date-time; every other part is text. country: code | code3 | code2 | name | currency currency: code | name region: code | name email: username | domain | full_domain | tld url: proto | domain | tld | path | querystring name: prefix | given | first | middle | family | last | surname | suffix | nickname | first_last | last_first | complete_name address: full | street | street1 | street2 | city | locality | state | province | region | postal | zip | postcode | country phone: phone | e164 | cc | ndc | area | sn | prefix | line | number | extension | country flight: flight:airline | flight:number uuid: time | version | uuid:variant credit_card: credit_card:brand | credit_card:last4 | credit_card:masked | credit_card:iin ssn: ssn:state_guess | ssn:masked | ssn:area | ssn:group | ssn:serial routing_number: routing_number:fed_district vin: vin:model_year | vin:manufacturer | vin:country | vin:region | vin:wmi | vin:plant | vin:serial | vin:vds iban: iban:country | iban:formatted | iban:bban | iban:check_digits swift_bic: swift_bic:bank | swift_bic:country | swift_bic:location | swift_bic:branch | swift_bic:is_test isbn: isbn:to_13 | isbn:to_10 | isbn:prefix gtin: gtin:gs1_prefix_country | gtin:gtin14 isin: isin:country | isin:nsin container: container:owner | container:category | container:serial imei: imei:tac | imei:serial ca_postal: ca_postal:rural |
HASH |
HASH(value, algorithm) → string |
Hash of a value's text as lowercase hex: md5, sha1, sha256, sha384, sha512, or a short checksum — crc32, crc32c, adler32, crc16 (CCITT-FALSE), crc16_modbus, crc16_xmodem, fnv1a32, fnv1a64 (case, dashes ignored: "SHA-256" works). Blank stays blank algorithm: md5 | sha1 | sha256 | sha384 | sha512 | crc32 | crc32c | adler32 | crc16 | crc16_modbus | crc16_xmodem | fnv1a32 | fnv1a64 |
ISTEXT |
ISTEXT(value) → boolean ALL |
True for non-blank text, including text that reads as a number or date ("12"); false for numbers, dates and blank. Several values → all of them; ANY(ISTEXT(a, b)) for any |
JOIN |
JOIN(sep, text, …) → string |
Join text values with a separator |
LANGUAGE |
LANGUAGE(text, candidate, …) → string |
Language code of the text (en, fr, ja). List candidate codes to choose only between them — needed for short or name-heavy text such as addresses. Blank when it cannot be told with confidence |
LEFT |
LEFT(text, n) → string |
First N characters of text |
LEN |
LEN(text) → integer |
Number of characters in text |
LINECOUNT |
LINECOUNT(text) → integer |
Number of lines in text. CRLF, CR and LF each end one line; a line break at the very end does not start another ("a\n" is 1 line, "a\n\n" is 2). Empty text is 0 lines; blank stays blank |
LOWER |
LOWER(text) → string |
Convert text to lowercase |
MD5 |
MD5(value) → string |
MD5 hash of a value's text as 32 lowercase hex characters (HASH(value, "md5")) |
NAME |
NAME(source, part) → string |
Extract a component from a person's name (given, family, middle, prefix, suffix, nickname, first_last, last_first, complete_name) part: complete_name | family | first | first_last | given | last | last_first | middle | nickname | prefix | suffix | surname |
NUMBERVALUE |
NUMBERVALUE(text) → decimal |
Parse a text string as a number |
NUMERIC |
NUMERIC(text) → decimal |
Extract the longest numeric value (ignoring commas) from text |
PADLEFT |
PADLEFT(text, width, char) → string |
Left-pad text to a fixed width |
PADRIGHT |
PADRIGHT(text, width, char) → string |
Right-pad text to a fixed width |
PHONE |
PHONE(source, part) → string |
A component of a phone number. part optional (default phone: the clean number without extension). e164 is strict E.164; cc, ndc, sn are its parts; area, prefix, line are the North America names; country is a Country part: phone | e164 | cc | ndc | sn | area | prefix | line | number | extension | country |
PROPER |
PROPER(text) → string |
Capitalize the first letter of each word |
RAW |
RAW({col}) → string |
Original source string for the column exactly as loaded from file; for a value that is not a column, its text. LEN(RAW(x)) is the length as written |
REGEXEXTRACT |
REGEXEXTRACT(text, pattern) → string |
Extract the first regex match (or capture group) from text |
REGEXMATCH |
REGEXMATCH(text, pattern) → boolean |
True if text matches a regular expression |
REGEXREPLACE |
REGEXREPLACE(text, pattern, replacement) → string |
Replace regex matches in text with a replacement string |
REGEXSPLIT |
REGEXSPLIT(text, pattern, n) → string |
Nth token from splitting text wherever a regular expression matches; negative n counts from the end (-1 = last) |
REGION |
REGION(postal_code, country) → string |
State or province from a US ZIP or Canadian postal code. country optional: omit it to accept either (result is a Region); USA or CAN accepts only that country (result is a US State or CA Province) country: USA | CAN |
REJOIN |
REJOIN(sep, string, part, …) → string |
Split string on sep, extract the numbered parts (1-based), and rejoin them with sep |
REPEAT |
REPEAT(text, count) → string |
Repeat text N times |
REPLACE |
REPLACE(text, search, replacement) → string |
Replace occurrences of search text with replacement |
REVERSE |
REVERSE(text) → string |
Reverse the characters in a text string |
REVERSE_JOIN |
REVERSE_JOIN(sep, string) → string |
Split string on sep, reverse the parts, and rejoin with sep |
RIGHT |
RIGHT(text, n) → string |
Last N characters of text |
SHA256 |
SHA256(value) → string |
SHA-256 hash of a value's text as 64 lowercase hex characters (HASH(value, "sha256")) |
SLICE |
SLICE(text, start, end) → string |
Substring from start to end position |
SLUGIFY |
SLUGIFY(text) → string |
Convert text to a slug (lowercase, underscores, ASCII) |
SLUGIFY_SEP |
SLUGIFY_SEP(text, sep) → string |
Convert text to a slug using a custom separator character |
SPLIT |
SPLIT(text, delim, n) → string |
Nth token from splitting text by a delimiter; negative n counts from the end (-1 = last) |
STARTSWITH |
STARTSWITH(text, prefix) → boolean |
True if text starts with the given prefix |
TEXT |
TEXT(value, format) → string |
Format a value as text; format optional. Numbers use number patterns ("#,##0.00"); dates, date-times and times use date patterns ("yyyy-MM-dd", "h:mm a"); durations read "1d 2h 30m" or, with "h:mm" / "h:mm:ss", total hours on a clock |
TITLE |
TITLE(text) → string |
Title case: capitalize words except articles, short prepositions and conjunctions ("The Lord of the Rings") |
TRIM |
TRIM(text) → string |
Remove leading and trailing whitespace |
UNICODE |
UNICODE(text) → integer |
Unicode code point of the first character (Excel's UNICODE; CHAR reverses it) |
UPPER |
UPPER(text) → string |
Convert text to uppercase |
UUID |
UUID(value, …) → string |
UUID() random uuid (stable v4) UUID(value, …) made from values (v5) UUID(version, value, namespace) explicitly generated UUID(version, value, namespace) takes all details: version must be literal— version 3, 5 or 8 generate from a value; 4 seeded; 7 from a time (default the Document Time); 0 nil; -1 max |
VALIDATE |
VALIDATE(value, check, result) → boolean |
True when a value is a well-formed identifier of the named kind: VALIDATE(card, "credit_card"). An invalid value is an error saying why; result "bool" makes it false instead, for filters and counts. Blank stays blank. The codes and what they check: Identifier codes in the help check: one of 48 identifier codes (credit_card, ssn, vin, iban, isbn …) — see Identifier codes result: error | bool |
WORDCOUNT |
WORDCOUNT(text) → integer |
Number of words in text, counted as the Column Summary's Words: "don't", "U.S.A" and "1,234.50" are one word each, Chinese, Japanese and Thai are split into dictionary words, and punctuation and emoji are not words (0 for text with none). Blank stays blank |