Contact

LAMBDA in WPS Spreadsheet: Create a Reusable Formula Function

Logical Advanced WPS Spreadsheet

Create a WPS LAMBDA, call it with worksheet values, reuse it through a defined name, and understand a bounded recursive example.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

LAMBDA creates a formula function that you can call with inputs. For example, =LAMBDA(x,x+1)(4) has the independently calculated expectation 5. The first parentheses define the parameter and calculation; the second parentheses supply the input for this call.

Availability and evidence

The official WPS Academy LAMBDA lesson, dated February 2, 2024, identifies Chinese WPS Office for Windows Personal. Its video demonstrates immediate invocation, reuse through a defined name and a recursive sum. It does not identify the original introduction build, final supported version, every current Windows release, or availability in global-English, Mac, web and mobile clients.

The lesson was checked on October 19, 2026. Vendor demonstrations are distinguished below from original mathematical expectations. These examples were not executed in a current WPS installation, and cross-application name serialization or workbook interchange was not tested.

Syntax and the two sets of parentheses

A useful two-parameter pattern is:

=LAMBDA(quantity,price,quantity*price)(83,2)

The independent result is 166. Quantity and price are parameter names. The final argument inside LAMBDA is the calculation, quantity*price. The following (83,2) supplies the values in that same order.

For a one-parameter function, use a pattern such as =LAMBDA(x,x+1)(4). Additional parameter definitions precede the final calculation. This guide does not establish a maximum parameter count, optional invocation arguments, or an ISOMITTED contract. Supply the inputs required by the function you defined.

The official video’s equivalent multiplication uses Chinese parameter names and references B2/C2 containing 83 and 2. At about 69 seconds, its complete formula and displayed 166 are visible. The currency formatting on that worksheet does not make LAMBDA a currency-conversion function.

Example 1: calculate line totals

Create LambdaPractice. Enter this dataset in A1:C4:

Row A: Item B: Quantity C: Unit price
1 Item Quantity Unit price
2 Pen 12 2.5
3 Notebook 8 4
4 Clip 30 0.2

Put Line total in D1. In D2 enter:

=LAMBDA(quantity,price,quantity*price)(B2,C2)

Fill through D4. Independently expected results are 30, 32 and 6. The references outside the definition change with the row; the parameter names describe each call’s supplied values.

For this simple multiplication, =B2*C2 is shorter. LAMBDA is useful when the calculation becomes substantial or you want one named definition reused consistently. It does not make an incorrect price, unit or business rule correct.

Example 2: save a reusable name

The WPS demonstration uses the formula ribbon’s name-management workflow. On a disposable workbook copy:

  1. Open the name-management command available in your editor.
  2. Create a name such as LineTotal with this defining formula:
=LAMBDA(quantity,price,quantity*price)
  1. Check the scope shown in the name dialog and test it on the same worksheet first.
  2. In F2 enter =LineTotal(B2,C2); fill through F4.

Expected F2:F4 are 30, 32, 6, matching D2:D4. Keep both sets while checking the definition. Changing the named calculation can affect its callers, so review those dependencies before editing a shared workbook.

The source demonstrates named reuse; exact translated menu labels and name-scope choices can vary. Do not assume this guide establishes every permitted identifier or that another application preserves the definition unchanged.

Why an uninvoked definition can show #CALC!

At approximately 55 seconds, the official video shows the multiplication definition by itself returning #CALC!; the later invoked expression returns 166. This is a vendor-demonstrated error case, not a complete error catalogue.

Check whether you entered only the definition when you intended to calculate a result. For immediate use, append the input list. For reuse, save the definition through the name-management workflow and call that name. The lesson does not establish every error for mismatched arguments, invalid names or unsupported inputs, so those should not be guessed from Excel.

Advanced: a bounded recursive sum

The official video also demonstrates a function calling its own defined name. Its positive-integer example sums 1 through 100 and displays 5050. An English-name adaptation is SumTo, defined as:

=LAMBDA(x,IF(x=1,x,x+SumTo(x-1)))

On the same worksheet where the name is available, =SumTo(5) has independent expected result 15, and =SumTo(10) expects 55. The demonstrated 100 case expects 5050. The arithmetic check is n*(n+1)/2: for 100, 100×101/2 = 5050.

The stopping condition is x=1. Restrict this recipe to positive integers. Zero, negative or fractional values need a different validated definition; this recipe does not show that they will reach its stopping condition. No recursion-depth, timing or resource-limit guarantee is established. The direct arithmetic formula is simpler for this particular sum; recursion here illustrates the mechanism rather than recommending unnecessary work.

Troubleshooting and choosing the right tool

  • An input is in the wrong position: compare the call’s argument order with the definition. Parameter names document roles; the call still supplies values by position.
  • The named function is unavailable: inspect the name and its scope in the workbook, then test the immediate-call form separately. Do not assume a name exists just because its spelling appears in a cell.
  • A result changes after copying: inspect the cell references in the invocation, not only the parameter names inside the definition.
  • A recursive calculation does not terminate: stop using that input and inspect the stopping condition. Do not increase an undocumented limit to conceal an invalid recipe.
  • You only need an intermediate value: LET names values within one formula. IF provides conditional calculations, and SUM already handles ordinary worksheet totals.

Sources