diff --git a/WindowsForms/Calculation-Engine/Supported-Formulas/Math-Trigonometry.md b/WindowsForms/Calculation-Engine/Supported-Formulas/Math-Trigonometry.md index 8e16bf35c..ef01cd857 100644 --- a/WindowsForms/Calculation-Engine/Supported-Formulas/Math-Trigonometry.md +++ b/WindowsForms/Calculation-Engine/Supported-Formulas/Math-Trigonometry.md @@ -2533,3 +2533,494 @@ _SERIESSUM(x, n, m, coefficients)_ * The argument is non-numeric, it returns the `#VALUE!` error message. + + + +## XLOOKUP + + + +The `XLOOKUP` function allows you to search for a value in a range and return a corresponding value from another range, based on a specified search term. + + + +For example, you can look up the price of an item by its ID or find an employee's name by their employee ID. + + + +**Syntax:** + + + +_XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])_ + + + +**where:** + + + +* lookup_value: The value to search for. If omitted, `XLOOKUP` returns blank cells in lookup_array. + + + +* lookup_array: The range or array to search for lookup_value. + + + +* return_array: The range or array from which to return a corresponding value. + + + +* [if_not_found] (Optional): The value to return if no match is found. If omitted, `#N/A` is returned. + + + +* [match_mode] (Optional): Specifies the match type: + + + + * 0 - Exact match (default). + + + + * -1 - Exact match or next smaller item. + + + + * 1 - Exact match or next larger item. + + + + * 2 - Wildcard using `*`, `?`, and `~`. + + + +* [search_mode] (Optional): Specifies the search order: + + + + * 1 - Search from the first item (default). + + + + * -1 - Search from the last item. + + + + * 2 - Binary search in ascending order (requires sorted data). + + + + * -2 - Binary search in descending order (requires sorted data). + + + +**Remarks:** + + + +* `XLOOKUP` provides a more versatile alternative to older functions like `VLOOKUP`, `HLOOKUP`, and `LOOKUP`. + + + +* The function can search both vertically and horizontally across your data, allowing for more flexible data retrieval. + + + +* If no match is found and [if_not_found] is omitted, `XLOOKUP` will return a `#N/A` error. + + + +* The [match_mode] argument allows for control over exact, approximate, and wildcard matches. + + + +* The [search_mode] controls the search order, optimizing performance on larger datasets. + + + +## XMATCH + + + +The `XMATCH` function returns the relative position of an item in a range, similar to `MATCH`, but with additional capabilities for exact and approximate matches. + + + +**Syntax:** + + + +_XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])_ + + + +**where:** + + + +* lookup_value: The value to search for. + + + +* lookup_array: The array or range to search. + + + +* [match_mode] (Optional): Specifies the match type: + + + + * 0 - Exact match (default). + + + + * -1 - Exact match or next smallest item. + + + + * 1 - Exact match or next largest item. + + + + * 2 - Wildcard match using `*`, `?`, and `~`. + + + +* [search_mode] (Optional): Specifies the search order: + + + + * 1 - Search from first to last (default). + + + + * -1 - Search from last to first. + + + + * 2 - Binary search in ascending order (data must be sorted). + + + + * -2 - Binary search in descending order (data must be sorted). + + + +**Remarks:** + + +* `XMATCH` is useful for retrieving the position of a value within a range, with more flexibility than `MATCH`. + + + +* It supports both normal and reverse search directions, as well as wildcard matching. + + + +## FLOOR.MATH + + + +The `FLOOR.MATH` function rounds a number down to the nearest integer or a specified multiple of significance. + + + +**Syntax:** + + + +_FLOOR.MATH(number, significance, mode)_ + + + +**where:** + + + +* number: The number to be rounded down. + + + +* significance (Optional): The multiple to which to round down. Defaults to 1. + + + +* mode (Optional): Controls rounding of negative numbers. If omitted, negative numbers are rounded away from zero. + + + +**Remarks:** + + + +* By default, positive numbers are rounded down to the nearest integer (e.g., 6.3 becomes 6). + + + +* Negative numbers are rounded away from zero unless the mode argument is used (e.g., -6.7 becomes -7, but with mode set to -1, -6.3 becomes -6). + + + +* The significance argument defines the multiple to which the number is rounded down. For example, rounding 7.5 with a significance of 3 results in 6. + + + +* If number divided by significance has a remainder, the result is rounded down. + + + +## FLOOR.PRECISE + + + +The `FLOOR.PRECISE` function rounds a number down to the nearest integer or a specified multiple of significance, regardless of the sign. + + + +**Syntax:** + + + +_FLOOR.PRECISE(number, [significance])_ + + + +**where:** + + + +* number: The number to be rounded down. + + + +* significance (Optional): The multiple to which the number should be rounded. Defaults to 1. + + + +**Remarks:** + + + +* The absolute value of significance is used, meaning `FLOOR.PRECISE` always rounds down, regardless of whether the number is positive or negative. + + + +* If either the number or significance is zero, the function returns zero. + + + +* The rounding behavior remains consistent regardless of the signs of the number or significance. + + + +## ISO.CEILING + + + +The `ISO.CEILING` function rounds a number up to the nearest integer or a specified multiple of significance. It always rounds up, regardless of whether the number is positive or negative. If the number or significance is zero, it returns zero. + + + +**Syntax:** + + + +_ISO.CEILING(number, [significance])_ + + + +**where:** + + + +* number: The value to be rounded up. + + + +* significance (Optional): The multiple to which number is to be rounded. If omitted, it defaults to 1. + + + +**Remarks:** + + + +* The absolute value of the multiple is used, meaning `ISO.CEILING` always rounds up, regardless of the sign of the number or significance. + + + +* If either number or significance is zero, the function returns zero. + + + +## CEILING.PRECISE + + + +The `CEILING.PRECISE` function rounds a number up to the nearest integer or a specified multiple of significance. Like ISO.CEILING, it always rounds up regardless of whether the number is positive or negative. If the number or significance is zero, it returns zero. + + + +**Syntax:** + + + +_CEILING.PRECISE(number, [significance])_ + + + +**where:** + + + +* number: The value to be rounded up. + + + +* significance (Optional): The multiple to which the number is rounded. If omitted, it defaults to 1. + + + +**Remarks:** + + + +* `CEILING.PRECISE` uses the absolute value of the multiple, ensuring that the function rounds up regardless of the signs of the number or significance. + + + +* If the number or significance is zero, the result is zero. + + + +## HSTACK + + + +The `HSTACK` function combines arrays horizontally (side by side) to form a larger array. + + + +**Syntax:** + + + +_HSTACK(array1, [array2], ...)_ + + + +**where:** + + + +* array: The arrays to be appended horizontally. + + + +**Remarks:** + + + +* `HSTACK` returns an array where each input array is appended in a column-wise fashion. + + + + * Rows: The number of rows in the result will be the maximum number of rows across all input arrays. + + + + * Columns: The number of columns will be the sum of the columns from all input arrays. + + + +* If an array has fewer rows than the maximum row count, `#N/A` will fill the missing rows. You can use the `IFERROR` function to handle these errors. + + + +* `HSTACK` returns a `#N/A` error in the additional rows. Use `HSTACK` inside the `IFERROR` function to replace `#N/A` with the value of your choice. + + + +## VSTACK + + + +The function `VSTACK` appends arrays vertically (one below the other) to return a larger array. + + + +**Syntax:** + + + +_VSTACK(array1, [array2], ...)_ + + + +**where:** + + + +* array: The arrays to be appended vertically. + + + +**Remarks:** + + + +* `VSTACK` returns an array where each input array is appended in a row-wise fashion. + + + + * Rows: The result will have the combined number of rows from all input arrays. + + + + * Columns: The result will have the maximum column count of the input arrays. + + + +* If an array has fewer columns than the maximum width of the selected array. + + + +* `VSTACK` returns a `#N/A` error in the additional columns. Use `VSTACK` inside the `IFERROR` function to replace `#N/A` with the value of your choice. + + + +## PHI + + + +The `PHi` function returns the value of the probability density function for the standard normal distribution for a given number. + + + +**Syntax:** + + + +_PHIL(x)_ + + + +**where:** + + + +* x: The number for which the probability density is calculated. + + + +**Remarks:** + + + +* If x is not a valid numeric value, `PHI` will return the `#NUM!` error. + + + +* If x of an invalid data type, `PHI` will return the `#VALUE!` error. \ No newline at end of file diff --git a/WindowsForms/Calculation-Engine/Supported-Formulas/Text-Formulas.md b/WindowsForms/Calculation-Engine/Supported-Formulas/Text-Formulas.md index a3688807c..6df836477 100644 --- a/WindowsForms/Calculation-Engine/Supported-Formulas/Text-Formulas.md +++ b/WindowsForms/Calculation-Engine/Supported-Formulas/Text-Formulas.md @@ -1120,3 +1120,1009 @@ Remark: * The find text is not found it return `#VALUE!` error message. + + + +## UNIQUE + + + +The `UNIQUE` function returns a list of unique values from a specified range or array. + + + +**Syntax:** + + + +_UNIQUE(array, [by_col], [exactly_once])_ + + + +**where:** + + + +* array: The range or array from which to return unique values. + + + +* [by_col] (Optional): If `TRUE`, compares columns for uniqueness; if `FALSE` or omitted, compares rows. + + + +* [exactly_once] (Optional): If `TRUE`, returns only values that appear exactly once; if `FALSE` or omitted, returns all distinct values. + + + +**Remarks:** + + + +* The result will spill into adjacent cells if it’s the final result of a formula. + + + +* If [exactly_once] is set to `TRUE`, values that appear more than once are excluded from the result. + + + +* If [by_col] is `TRUE`, the function evaluates unique columns instead of rows. + + + +## TEXTAFTER + + + +The `TEXTAFTER` function extracts the text that appears after a specified delimiter in a string. + + + +**Syntax:** + + + +_TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])_ + + + +**where:** + + + +* text: The input text to search within. + + + +* delimiter: The text or character after which you want to extract. + + + +* [instance_num] (Optional): The instance of the delimiter to search for. Defaults to 1 (first instance). + + + +* [match_mode] (Optional): Determines if the search is case-sensitive (0 for case-sensitive, 1 for case-insensitive). + + + +* [match_end] (Optional): If `TRUE`, treats the end of the text as a delimiter. + + + +* [if_not_found] (Optional): Value to return if the delimiter is not found. Defaults to `#N/A`. + + + +**Remarks:** + + + +* If the delimiter is not found, a `#N/A` error is returned, unless [if_not_found] is specified. + + + +* If [instance_num] equal to 0 or greater than the length of text, a `#VALUE!` error returned. + + + +* The [instance_num] argument allows for both positive and negative numbers. Positive values search from the start, and negative values search from the end. + + + +* The function supports case-sensitive and case-insensitive search modes using the [match_mode] argument. + + + +## TEXTBEFORE + + + +The `TEXTBEFORE` function extracts the text that appears before a specified delimiter in a string. + + + +**Syntax:** + + + +_TEXTBEFORE(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])_ + + + +**where:** + + + +* text: The input text to search within. + + + +* delimiter: The text or character before which you want to extract. + + + +* [instance_num] (Optional): The instance of the delimiter to search for. Defaults to 1 (first instance). + + + +* [match_mode] (Optional): Case-sensitivity control (0 for case-sensitive, 1 for case-insensitive). + + + +* [match_end] (Optional): If TRUE, treats the end of the text as a delimiter. + + + +* [if_not_found] (Optional): Value to return if the delimiter is not found. Defaults to #N/A. + + + +**Remarks:** + + + +* If the delimiter is not found, a #N/A error is returned, unless if_not_found is specified. + + + +* if [instance_num] is equal to 0 or greater than the length of text, a `#VALUE!` error returned. + + + +* Similar to `TEXTAFTER`, negative [instance_num] values search from the end of the string. + + + +* The function supports both case-sensitive and case-insensitive search modes using the [match_mode] argument. + + + +## VALUETOTEXT + + + +The `VALUETOTEXT` function converts a value into a text format. + + + +**Syntax:** + + + +_VALUETOTEXT(value, [format])_ + + + +**where:** + + + +* value: The value to return to text. + + + +* [format] (Optional): Determines the format: + + + + * 0: Concise format (default). + + + + * 1: Strict format with escape characters for formulas. + + + +**Remarks:** + + + +* If an invalid format is provided, `#VALUE!` error is returned. + + + +* The concise format is human-readable, while the strict format preserves data structure. + + + +## ARRAYTOTEXT + + + +The `ARRAYTOTEXT` function function converts an array into text. + + + +**Syntax:** + + + +_ARRAYTOTEXT(array, [format])_ + + + +**where:** + + + +* array: The array to convert to text. + + + +* [format] (Optional): Determines the output format: + + + + * 0: Concise format (default). + + + + * 1: Strict format with escape characters and row delimiters. + + + +**Remarks:** + + + +* The concise format displays the output within a single cell, while the strict format presents a more detailed array layout with escape characters. + + + +* If the `format` argument is not 0 or 1, a `#VALUE!` error is returned. + + + +## TOCOL + + + +The `TOCOL` function transforms an array into a single column. + + + +**Syntax:** + + + +_TOCOL(array, [ignore], [scan_by_column])_ + + + +**where:** + + + +* array: The array to convert into a column. + + + +* [ignore] (Optional): Specifies which values to ignore: + + + + * 0: Keep all values (default). + + + + * 1: Ignore blanks. + + + + * 2: Ignore errors. + + + + * 3: Ignore blanks and errors. + + + +* [scan_by_column] (Optional): If `TRUE`, scans by column instead of by row. + + +**Remarks:** + + + +* The function will return all values in a single column, even if the original array was multidimensional. + + + +* If [scan_by_column] is set to `TRUE`, the function will scan the array by column; otherwise, it defaults to scanning by row. + + + +* If an array contains non-integer values, the function returns a `#VALUE!` error. + + + +## TOROW + + + +The `TOROW` function transforms an array into a single row. + + + +**Syntax:** + + + +_TOROW(array, [ignore], [scan_by_column])_ + + + +**where:** + + + +* array: The array to convert into a row. + + + +* [ignore] (Optional): Specifies which values to ignore: + + + + * 0: Keep all values (default) + + + + * 1: Ignore blanks. + + + + * 2: Ignore errors. + + + + * 3: Ignore blanks and errors. + + + +* [scan_by_column] (Optional): If `TRUE`, scans by column. + + + +**Remarks:** + + + +* The function will return all values in a single row, even if the original array was multidimensional. + + + +* If [scan_by_column] is set to `TRUE`, the function will scan the array by column; otherwise, it defaults to scanning by row. + + + +* If an array contains non-integer values, the function returns a `#VALUE!` error. + + + +## CHOOSECOLS + + + +The `CHOOSECOLS` function returns specified columns from an array. + + + +**Syntax:** + + + +_CHOOSECOLS(array, col_num1, [col_num2], …)_ + + + +**where:** + + + +* array: The array containing columns to be selected. + + + +* col_num1: The index of the first column to return. + + + +* [col_num2] (Optional): Additional columns to return. + + + +**Remarks:** + + + +* If any [col_num] is zero or exceeds the total number of columns, a `#VALUE!` error is returned. + + + +* The function is useful for extracting only certain columns from a large dataset. + + + +## CHOOSEROWS + + + +The `CHOOSEROWS` function returns specified rows from an array. + + + +**Syntax:** + + + +_CHOOSEROWS(array, row_num1, [row_num2], …)_ + + + +**where:** + + + +* array: The array containing the rows to be selected. + + + +* row_num1: The index of the first row to return. + + + +* [row_num2] (Optional): Additional rows to return. + + + +**Remarks:** + + + +* A `#VALUE!` error occurs if any [row_num] exceeds the number of rows or is zero. + + + +* The function is useful for extracting specific rows from a dataset. + + + +## SEQUENCE + + + +The `SEQUENCE` function generates a sequence of numbers in an array. + + + +**Syntax:** + + + +_SEQUENCE(rows, [columns], [start], [step])_ + + + +**where:** + + + +* rows: The number of rows for the sequence. + + + +* [columns] (Optional): The number of columns. + + + +* [start] (Optional): The starting number. + + + +* [step] (Optional): The increment for each number. + + + +**Remarks:** + + + +* Defaults to 1 for all omitted optional arguments. If no start or step values are specified, the sequence starts at 1 and increments by 1. + + + +* The function spills the result into adjacent cells when it generates the array. + + + +* `SEQUENCE` can create multi-dimensional arrays by specifying both rows and columns. + + + +## TEXTSPLIT + + + +The `TEXTSPLIT` function splits text into arrays based on delimiters. + + + +**Syntax:** + + + +_TEXTSPLIT(text, col_delimiter, [row_delimiter], [ignore_empty], [match_mode], [pad_with])_ + + + +**where:** + + + +* text: The input text to split. + + + +* col_delimiter: The delimiter to split the text into columns. + + + +* [row_delimiter] (Optional): The delimiter to split the text into rows. + + + +* [ignore_empty] (Optional): If `TRUE`, ignores consecutive delimiters. Defaults to `FALSE`. + + + +* [match_mode] (Optional): If 1, performs a case-insensitive match. Defaults to 0 (case-sensitive). + + + +* [pad_with] (Optional): The value to use for padding missing elements. Defaults to `#N/A`. + + + +**Remarks:** + + + +* If no [row_delimiter] is provided, the function will only split by columns. You can use multiple delimiters by specifying an array of delimiters. + + + +* The [ignore_empty] option allows consecutive delimiters to be ignored, which is useful when parsing text that contains multiple delimiters. + + + +* The [pad_with] argument is used to fill in empty cells when the result array is not rectangular. + + + +## TAKE + + + +The `TAKE` function returns a specified number of contiguous rows or columns from the start or end of an array. + + + +**Syntax:** + + + +_TAKE(array, rows, [columns])_ + + + +**where:** + + + +* array: The array from which to take rows or columns. + + + +* rows: The number of rows to take. A negative value takes rows from the end of the array. + + + +* [columns] (Optional): The number of columns to take. A negative value takes columns from the end of the array. + + + +**Remarks:** + + + +* `TAKE` returns a `#CALC!` error if either rows or columns are set to 0, as this results in an empty array. + + + +* If the specified array is too large, `TAKE` returns a `#NUM!` error. + + + +* The function allows easy extraction of portions of data, especially for summarizing or splitting tables. + + + +## DROP + + + +The `DROP` function excludes a specified number of rows or columns from the start or end of an array. This function is useful for removing headers, footers, or sections of data in an array. + + + +**Syntax:** + + + +_DROP(array, rows, [columns])_ + + + +**where:** + + + +* array: The array from which to drop rows or columns. + + + +* rows: The number of rows to drop. A negative value drops from the end of the array. + + + +* [columns] (Optional): The number of columns to drop. A negative value drops columns from the end. + + + +**Remarks:** + + + +* A `#CALC!` error is returned if rows or columns are set to 0, creating an empty array. + + + +* If the array exceeds the allowed size limit, `DROP` returns a `#NUM!` error. + + + +* The function helps to clean up datasets, such as removing unnecessary columns or rows before analysis. + + + +## EXPAND + + + +The `EXPAND` function expands or pads an array to specified row and column. + + + +**Syntax:** + + + +_EXPAND(array, rows, [columns], [pad_with])_ + + + +**where:** + + + +* array: The array to expand. + + + +* rows: The number of rows in the expanded array. + + + +* [columns] (Optional): The number of columns in the expanded array. + + + +* [pad_with] (Optional): The value to pad with if the array is smaller than the target size. Defaults to `#N/A`. + + + +**Remarks:** + + + +* If the rows or columns argument is less than the original array's dimensions, `EXPAND` will return a `#VALUE!` error. + + + +* Padded cells use the [pad_with] argument; if omitted, it defaults to `#N/A`. + + + +* Useful for filling or aligning datasets to match specific table structures. + + + +## WRAPROWS + + + +The `WRAPROWS` function wraps a one-dimensional vector into rows after a specified number of elements to form a new array. + + +**Syntax:** + + + +_WRAPROWS(vector, wrap_count, [pad_with])_ + + + +**where:** + + + +* vector: The row or column of values to wrap. + + + +* wrap_count: The maximum number of elements in each row. + + + +* [pad_with] (Optional): The value used to fill in any remaining cells if the array cannot be evenly divided. Defaults to `#N/A`. + + + +**Remarks:** + + + +* If the [wrap_count] is greater than the length of the vector, the vector is returned in a single row. + + + +* The function returns a `#VALUE!` error if the input is not a one-dimensional array. + + + +* If [wrap_count] is less than 1, a `#NUM!` error occurs. + + + +* Cells that cannot be filled are assigned `#N/A`, unless otherwise specified with [pad_with]. + + + +## WRAPCOLS + + + +The `WRAPCOLS` function wraps a one-dimensional vector into columns after a specified number of elements to form a new array. + + + +**Syntax:** + + + +_WRAPCOLS(vector, wrap_count, [pad_with])_ + + + +**where:** + + + +* vector: The row or column of values to wrap. + + + +* wrap_count: The maximum number of elements in each column. + + + +* [pad_with] (Optional): The value used to fill in any remaining cells if the array cannot be evenly divided. Defaults to `#N/A`. + + + +**Remarks:** + + + +* If [wrap_count] exceeds the length of the vector, the vector is returned in a single column. + + + +* If the vector is not a one-dimensional array, a `#VALUE!` error is returned. + + + +* A `#NUM!` error occurs if [wrap_count] is less than 1. + + + +* Empty cells in the new array are filled with `#N/A` unless specified otherwise. + + + +## SORT + + + +The `SORT` function sorts the contents of an array in either ascending or descending order. + + + +**Syntax:** + + + +_SORT(array, [sort_index], [sort_order], [by_col])_ + + + +**where:** + + + +* array: The array or range to sort. + + + +* [sort_index] (Optional): The index (row or column number) to sort by. Defaults to the first row/column. + + + +* [sort_order] (Optional): 1 for ascending (default), -1 for descending. + + + +* [by_col] (Optional): `FALSE` (default) to sort by rows, or `TRUE` to sort by columns. + + + +**Remarks:** + + + +* When [sort_index] or [sort_order] is omitted, Excel defaults to sorting the first row or column in ascending order. + + + +* `SORT` automatically spills the result into adjacent cells, making it convenient for dynamic arrays. + + + +* Use the `SORTBY` function when you need more flexible sorting based on multiple criteria. + + + +## SORTBY + + + +The `SORTBY` function sorts an array based on values in a separate corresponding array or range. + + + +**Syntax:** + + + +_SORTBY(array, by_array1, [sort_order1], [by_array2, sort_order2], …)_ + + + +**where:** + + + +* array: The array to sort. + + + +* by_array1: The array or range to sort by. + + + +* [sort_order1] (Optional): 1 for ascending (default), -1 for descending. + + + +* [by_array2], [sort_order2] (Optional): Additional arrays and their sort orders, if needed. + + + +**Remarks:** + + + +* The function allows sorting on multiple criteria. + + + +* Results are returned in a dynamic array that spills into adjacent cells. + + + +* If no sort order is specified, Excel defaults to ascending order. + + + +* Unlike `SORT`, `SORTBY` enables sorting based on multiple, unrelated criteria or arrays. + + + +## FILTER + + + +The `FILTER` function returns an array of values filtered based on criteria you define. + + + +**Syntax:** + + + +_FILTER(array, include, [if_empty])_ + + + +**where:** + + + +* array: The array, or range to filter. + + + +* include: A Boolean array (same size as array) that indicates which values to keep. + + + +* [if_empty] (Optional): The value to return if no results match the criteria. Defaults to a `#CALC!` error. + + + +**Remarks:** + + + +* The `FILTER` function automatically spills the results into adjacent cells. + + + +* If no matches are found, and [if_empty] is not defined, Excel returns a `#CALC!` error. + + + +* `FILTER` will return an error if the include array is not Boolean, or if it contains errors such as `#N/A` or `#VALUE!`. \ No newline at end of file