In this article:

May 8, 2024

The LAMBDA function in Google Sheets allows users to define their own custom functions directly within the Google Sheets formula bar. This feature enables complex calculations and data manipulations that were previously only possible by writing custom scripts in Google Apps Script or by using complex combinations of built-in functions.

The basic structure of a LAMBDA function is as follows:

**LAMBDA(parameter1, parameter2, ..., expression)**

Here's a breakdown of each part of the syntax:

**LAMBDA:**This is the function name that signals you are defining a lambda function.

**parameters:**These are the placeholders for the values that you will pass to your lambda function when you call it. You can define zero or more parameters which are separated by commas. Each parameter acts as a variable within the lambda function, representing the input values the function will use when executed.

**expression:**This is the calculation or operation that the lambda function will perform using the parameters provided.It can involve simple calculations, cell references, or combinations of other functions. The expression is what defines the output of your lambda function based on the input parameters.

Follow the process below to use the LAMBDA function in Google Sheets.

For example, to add two numbers: type =LAMBDA(a, b, a + b) in a cell, where 'a' and 'b' are the numbers you want to add.

To execute your function, add arguments at the end: =LAMBDA(a, b, a + b)(2, 3).

This returns the sum of 2 and 3.

For more complex formulas, we’ll calculate the average of three numbers: =LAMBDA(a, b, c, (a + b + c) / 3)(5, 10, 15). This calculates the average of 5, 10, and 15.

Use cell references instead of direct numbers: =LAMBDA(a, b, a + b)(A1, B1) adds the values in cells A1 and B1.

Name your LAMBDA function for reuse. Go to Data > Named ranges...,

Then, define a name and click "Done". Use this name instead of the whole expression.

Call your named function in a cell with its parameters: If your addition function is named "add", type =add(A1, B1) to use it.

Check for typos, incorrect cell references, or syntax errors if there are issues. Make sure parameters are correctly utilized.

We hope that you now have a better understanding of how to use the Google Sheets LAMBDA function. If you enjoyed this article, you might also like our article on how to set up image functions in Google Sheets or our article on how to make labels on Google Sheets.

Get Google Sheets productivity and automation tips delivered straight to your inbox

We'll email you 1-3 times a week — and never share your information.

Get your copy of our free Google Sheets automation guide!

- 27 pages of Google Sheets tips and tricks to save time
- Covers pivot tables and other advanced topics
- 100% free

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->