When using online Excel, what methods can introduce calculation functions?

Abstract: This article was originally published on CSDN by the technical team of Grape City. Please indicate the source of the reprint: Grape City official website , Grape City provides developers with professional development tools, solutions and services to empower developers.

foreword

In daily life and work, we all use calculation formula functions in Excel more or less, such as sum formula, average formula, etc. Today, we have sorted out some formula functions that can be introduced in online Excel.

basic function

Excel contains 450 basic native functions: such as common sum and difference functions, maximum and minimum functions, etc. Due to space reasons, a detailed explanation of native functions can be found here .

How to introduce basic functions in Excel:

1. The introduction of basic native functions.

2. The introduction of custom functions. (In addition to the native functions that come with Excel, create your own custom functions with specific business use cases, you can define and call them like any built-in function)

3. Iterative calculations/circular references (can help find solutions to certain calculations by running it over and over with previous results)

4. Introduction of asynchronous function ( AsyncFunction function to calculate asynchronous data, this function is used when the calculation result cannot be obtained immediately)

Array formulas and dynamic arrays

Array formulas are formulas that perform multiple calculations on one or more items in an array. You can think of an array as a row of values, a column of values, or a combination of row and column values. Array formulas can return multiple results, or one result. Dynamic arrays are used to replace array formulas. Any formula that may return multiple results can be called a dynamic array formula. A formula that currently returns multiple results and overflows successfully can be called an overflowing array formula.

How to introduce array formulas and dynamic arrays in Excel:

  1. The introduction of array formulas

Introduction of dynamic array

2. The introduction of the Filter function (the FILTER function can filter a series of data according to the defined conditions)

The FILTER function filters an array based on a boolean array.

grammar:

FILTER(array, include, if_empty?)

parameter required describe
array yes array or range to filter
include yes a boolean array with the same height or width as the array to be filtered
[if_empty] no Return value if all values ​​in the contained array are empty (filter result is empty)

3. Introduction of RANDARRAY function

The RANDARRAY function returns an array of random numbers. The user can specify the number of rows and columns to fill, the minimum and maximum values, and return integer or decimal values.

grammar:

RANDARRAY(rows?, columns?, min?, max?, whole_number?)

parameter required describe
[rows] no the number of rows to return data
[columns] no The number of columns to return data
[min] no minimum random number
[max] no The maximum value of the random number
[whole_number] no Returns an integer or float: true for integers, false for floats.

4. Introduction of SEQUENCE function

The SEQUENCE function can generate a sequential sequence of numbers, such as 1, 2, 3, 4.

grammar:

SEQUENCE(rows, columns?, start?, step?)

parameter required describe
rows yes the number of rows to return data
[columns] no The number of columns to return data
[start] no the first number of the sequence
[step] no Incrementing value in sequence

5. UNIQUE function

The UNIQUE function returns a list of unique values ​​in a list or range.

grammar:

UNIQUE(array, by_col?, occurs_once?)

parameter required describe
array yes Returns a range or array of unique values
[by_col] no A boolean indicating how to compare; omit or false to row by column; true to column by column
[occurs_once] no Boolean, true returns only one occurrence, false or omitted returns all unique values

6. SORT BY function

The SORTBY function sorts the contents of a range or array according to the values ​​in the corresponding range or array.

grammar:

SORTBY(array, by_array1, [sort_order1], [by_array2, sort_order2], …)

parameter required describe
array yes the array or range to sort
by_array1 yes the array or range to sort
[sort_order1] no The order to use for sorting. 1 means ascending order, -1 means descending order. The default is "Ascending".
[by_array2] no the array or range to sort
[sort_order2] no The order to use for sorting. 1 means ascending order, -1 means descending order. The default is "Ascending".

7. Implicit intersection operator: @

Implicit intersection logic reduces multiple values ​​to a single value. Users can add @ before the formula to force the formula to return a single value, since a cell can only contain one value. Implicit intersection does nothing (even if it's done behind the scenes) if the formula returns a value. The logic works like this:

  • If the value is a single item, return that item.
  • If the value is a range, returns the value from the cell in the same row or column as the formula.
  • If the value is an array, the upper left value is selected.

LAMBDA function set

1. LAMBDA function

The LAMBDA function enables you to define custom functions using Excel's own formula language.

grammar:

LAMBDA([parameter1, parameter2, …,] calculation)

  1. MAP function

Returns an array formed by applying LAMBDA to map each value in the array to a new value.

grammar:

MAP(array1, lambda_or_array<#>)

The syntax of the MAP function has the following parameters.

  • array1
    An array to be mapped.
  • lambdaorarray <#>
    A LAMBDA, which must be the last argument, which must provide an argument for each passed array, or another array to be mapped.

  1. REDUCE function

Reduces an array to an accumulated value by applying LAMBDA to each value, and returns the total value in the accumulator.

grammar:

REDUCE(initial_value, array, lambda(accumulator, value))

  • initial_value
    sets the starting value of the accumulator.
  • array
    An array to be reduced.
  • lambda
    calls a LAMBDA to reduce an array. The lambda takes two parameters.
    • The accumulator
      values ​​are added together and returned as the final result.
    • value
      The calculation applied to each element in the array.

4. SCAN function

Scans an array by applying LAMBDA to each value, and returns an array with each intermediate value.

grammar:

SCAN([initial_value], array, lambda(accumulator, value))

  • initial_value
    sets the starting value of the accumulator.
  • array
    An array to scan.
  • lambda
    A LAMBDA that is invoked to scan the array. The lambda takes two parameters.
    • The accumulator
      values ​​are added together and returned as the final result.
    • value
      The calculation applied to each element in the array.

5. MAKEARRAY function

Returns a computed array of the specified row and column size by applying LAMBDA.

grammar:

MAKEARRAY(rows, cols, lambda(row, col))


  • The number of rows in the rows array. Must be greater than zero.

  • The number of columns in the cols array. Must be greater than zero.
  • lambda
    calls a LAMBDA to create the array. The lambda takes two parameters.

    • The row index of the row array.
    • The column index of the col
      array.

6. BYROW function

Applies LAMBDA to each row, and returns an array of the results. For example, if the original array was 3 columns and 2 rows, the returned array is 1 column and 2 rows.

grammar:

BYROW(array, lambda(row))

  • array
    An array to be separated by columns.
  • lambda
    A LAMBDA that takes a row as a single argument and computes a result. The lambda takes a single argument.

    • A row in the row array.

7. BYCOL function

Applies LAMBDA to each column, and returns an array of the results. For example, if the original array was 3 columns and 2 rows, the returned array is 3 columns and 1 row.

grammar:

  • array
    An array to be separated by columns.
  • lambda
    A LAMBDA that takes a column as a single argument and computes a result. The lambda takes a single argument.

    • A column in the column array.

8. ISOMITTED function

Checks for missing values ​​in LAMBDA and returns TRUE or FALSE.

grammar:

ISOMITTED(argument)

  • argument
    The value you want to test, such as a LAMBDA parameter.

In addition to the above calculation formula functions, you can also find more demos of online tables in the actual code library , including Excel import and export , data binding , printing , copy and paste , data verification and other functional modules. Welcome to visit .

Extension link:

Implementing Excel server-side import and export under the Spring Boot framework

Project Combat: Online Quotation Procurement System (React +SpreadJS+Echarts)

Svelte framework combined with SpreadJS to realize pure front-end Excel online report design

Guess you like

Origin blog.csdn.net/powertoolsteam/article/details/132068675
Recommended