Formula Functions
VimSheet includes over 100 built-in functions organized by category.
Functions can be used in formulas: =SUM(A1:A10), =IF(B1>0, "OK", "NOK").
Mathematical Functions
- ABS(x)
Return the absolute value of x.
- SUM(range, ...)
Sum all values in the given ranges or numbers.
- AVERAGE(range, ...)
Return the arithmetic mean of values.
- AVG(range, ...)
Alias for
AVERAGE.
- COUNT(range, ...)
Count numeric values in the range.
- COUNTA(range, ...)
Count non-empty values in the range.
- MIN(range, ...)
Return the minimum value.
- MAX(range, ...)
Return the maximum value.
- MEDIAN(range, ...)
Return the median of values.
- MODE(range, ...)
Return the most frequently occurring value.
- STDEV(range, ...)
Return the sample standard deviation.
- STDEVS(range, ...)
Return the population standard deviation.
- VAR(range, ...)
Return the sample variance.
- VARS(range, ...)
Return the population variance.
- PERCENTILE(range, p)
Return the p-th percentile of values (0-100).
- SUMIF(range, condition[, sum_range])
Sum values conditionally.
- COUNTIF(range, condition)
Count values meeting a condition.
- AVERAGEIF(range, condition[, avg_range])
Average values meeting a condition.
- SUBTOTAL(func_num, range, ...)
Apply a subtotal function (1=AVERAGE, 9=SUM, etc.).
- PRODUCT(range, ...)
Multiply all values together.
- PROD(range, ...)
Alias for
PRODUCT.
- ROUND(x, digits)
Round x to digits decimal places.
- ROUNDUP(x, digits)
Round x up (away from zero).
- ROUNDDOWN(x, digits)
Round x down (toward zero).
- CEILING(x, significance)
Round x up to the nearest multiple of significance.
- FLOOR(x, significance)
Round x down to the nearest multiple of significance.
- CEIL(x, significance)
Alias for
CEILING.
- INT(x)
Truncate x to an integer.
- TRUNC(x[, digits])
Truncate x to digits decimal places.
- MOD(x, y)
Return the remainder of
x / y.
- POWER(x, y)
Return x raised to the power of y (same as
x ^ y).
- POW(x, y)
Alias for
POWER.
- SQRT(x)
Return the square root of x.
- EXP(x)
Return e raised to the power of x.
- LN(x)
Return the natural logarithm of x.
- LOG(x[, base])
Return the logarithm of x with given base (default 10).
- LOG10(x)
Return the base-10 logarithm of x.
- SIN(x)
Return the sine of x (radians).
- COS(x)
Return the cosine of x (radians).
- TAN(x)
Return the tangent of x (radians).
- ASIN(x)
Return the arcsine of x in radians.
- ACOS(x)
Return the arccosine of x in radians.
- ATAN(x)
Return the arctangent of x in radians.
- ATAN2(y, x)
Return
atan2(y, x)in radians.
- HYPOT(x, y)
Return
sqrt(x² + y²).
- SIGN(x)
Return the sign of x (-1, 0, or 1).
- FACT(n)
Return the factorial of n.
- FACTORIAL(n)
Alias for
FACT.
- GCD(a, b, ...)
Return the greatest common divisor.
- LCM(a, b, ...)
Return the least common multiple.
- PI()
Return the value of π (3.14159…).
- E()
Return the value of e (2.71828…).
- RAND()
Return a random float between 0 and 1.
- RANDBETWEEN(bottom, top)
Return a random integer between bottom and top (inclusive).
- RADIANS(x)
Convert degrees to radians.
- DTR(x)
Alias for
RADIANS.
- DEGREES(x)
Convert radians to degrees.
- RTD(x)
Alias for
DEGREES.
Logical Functions
- IF(condition, true_val, false_val)
Return true_val if condition is truthy, else false_val.
- IFS(condition1, value1[, condition2, value2, ...])
Evaluate multiple conditions, return value for the first true condition.
- AND(condition, ...)
Return
TRUEif all conditions are true.
- OR(condition, ...)
Return
TRUEif any condition is true.
- XOR(condition, ...)
Return
TRUEif an odd number of conditions are true.
- NOT(condition)
Return the logical opposite.
- IFERROR(value, default)
Return default if value evaluates to an error, otherwise value.
- IFNA(value, default)
Return default if value is
#N/A, otherwise value.
- SWITCH(expr, val1, result1[, default])
Match expr against values and return corresponding result.
- TRUE()
Return the boolean
TRUE.
- FALSE()
Return the boolean
FALSE.
- ISBLANK(value)
Return
TRUEif value is empty or blank.
- ISNUMBER(value)
Return
TRUEif value is numeric.
- ISTEXT(value)
Return
TRUEif value is text.
- ISERROR(value)
Return
TRUEif value is any error value.
Text Functions
- LEN(text)
Return the length (number of characters) of text.
- LEFT(text, n)
Return the first n characters.
- RIGHT(text, n)
Return the last n characters.
- MID(text, start, n)
Return n characters starting at position start (1-indexed).
- CONCATENATE(text1, text2, ...)
Join text strings together (same as
&operator).
- CONCAT(text1, text2, ...)
Alias for
CONCATENATE.
- UPPER(text)
Convert text to uppercase.
- LOWER(text)
Convert text to lowercase.
- PROPER(text)
Capitalize the first letter of each word.
- TRIM(text)
Remove leading and trailing whitespace.
- FIND(find_text, within_text[, start])
Return the position of find_text in within_text (1-indexed).
- REPLACE(old_text, start, n, new_text)
Replace n characters starting at start with new_text.
- SUBSTITUTE(text, old, new[, n])
Substitute old text with new text (optionally only the n-th occurrence).
- TEXT(value, format)
Format a number as text using a format string.
- VALUE(text)
Convert a text string to a number.
- REPT(text, n)
Repeat text n times.
- REPEAT(text, n)
Alias for
REPT.
- EXACT(text1, text2)
Return
TRUEif two strings are exactly equal (case-sensitive).
- CHAR(code)
Return the character for the given ASCII/Unicode code.
- CODE(text)
Return the ASCII/Unicode code of the first character of text.
Lookup and Reference
- VLOOKUP(lookup_value, table_array, col_index[, range_lookup])
Vertical lookup. Search the first column of table_array for lookup_value and return the value at col_index. Set range_lookup to
FALSEfor exact match.
- HLOOKUP(lookup_value, table_array, row_index[, range_lookup])
Horizontal lookup. Search the first row of table_array for lookup_value and return the value at row_index.
- XLOOKUP(lookup_value, lookup_array, return_array[, if_not_found])
Modern lookup that searches lookup_array and returns the corresponding value from return_array.
- INDEX(range, row[, column])
Return the value at the specified position within a range.
- MATCH(lookup_value, lookup_array[, match_type])
Return the relative position of lookup_value in lookup_array.
match_type: 0=exact, 1=ascending, -1=descending.
- CHOOSE(index, value1, value2, ...)
Return the index-th value from the argument list (1-indexed).
- ROW([cell])
Return the row number of cell (or current cell). 1-indexed.
- COL([cell])
Return the column number of cell (or current cell). 1-indexed.
- ROWS(range)
Return the number of rows in range.
- COLS(range)
Return the number of columns in range.
- OFFSET(cell, rows, cols[, height][, width])
Return a reference offset from cell by rows and cols.
- INDIRECT(ref_text)
Return the reference specified by a text string.
Date Functions
- TODAY()
Return today’s date.
- NOW()
Return the current date and time.
- DATE(year, month, day)
Create a date from year, month, and day components.
- TIME(hour, minute, second)
Create a time from hour, minute, and second components.
- YEAR(date)
Extract the year from a date.
- MONTH(date)
Extract the month (1-12) from a date.
- DAY(date)
Extract the day of the month from a date.
- HOUR(time)
Extract the hour (0-23) from a time.
- MINUTE(time)
Extract the minute (0-59) from a time.
- SECOND(time)
Extract the second (0-59) from a time.
- DATEDIF(start_date, end_date, unit)
Return the difference between dates. unit:
"Y"(years),"M"(months),"D"(days),"MD","YM","YD".
- EDATE(start_date, months)
Return the date months away from start_date.
- EOMONTH(start_date, months)
Return the last day of the month months away from start_date.
- WEEKDAY(date[, return_type])
Return the day of the week (1=Sunday by default).
- WEEKNUM(date)
Return the week number of the year.
- NETWORKDAYS(start_date, end_date)
Return the number of working days between two dates.
Data Fetching
- FETCH(url[, refresh_seconds][, json_path])
Fetch data from a URL asynchronously. Data is refreshed in the background. Use json_path (dot/bracket notation) to extract a specific value, e.g.,
FETCH("https://api.example.com/data", 60, "$.results[0].value").