# Google Sheets LAMBDA Function: Syntax, Examples & Tips

- URL: https://betteranalyst.com/google-sheets/lambda-function
- Author: Better Analyst

Formula Bot is now Better Analyst—same account, more powerful analysis.Formula Bot is now Better Analyst—same account and workflows, with more powerful analysis, dashboards, and automation.

[Learn what changed](https://betteranalyst.com/formula-bot-is-now-better-analyst)

The LAMBDA function creates custom functions in Google Sheets, allowing users to define reusable formulas with parameters.

```
LAMBDA(name, formula_expression)
```

Generate FormulaExplain Formula

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

Describe the LAMBDA you need in plain EnglishGenerate Formula

## Parameters

**`name`**:\
The name you want to assign to the LAMBDA function, which can be used to reference the function later in your spreadsheet.

**`formula_expression`**:\
The formula or expression that defines the calculations or operations the LAMBDA function will perform, which can include references to parameters or other functions.

## What is a LAMBDA Function?

The *LAMBDA* function in Google Sheets is a revolutionary feature that allows users to create custom functions using the built-in formula language. This function enables you to define a formula with parameters, which can then be reused throughout your spreadsheet, making your formulas cleaner and more efficient. LAMBDA essentially turns complex formulas into simple, reusable functions.

In simpler terms, LAMBDA allows you to encapsulate a formula into a single function that you can call with different inputs, streamlining your spreadsheet operations.

## A Practical Example

Imagine you are calculating the total price of items in an order, including tax. You have a list of items with their prices and a tax rate that you want to apply.

### Items Table:

| ItemID | ItemName | Price |
| - | - | - |
| 1 | Widget A | 20.00 |
| 2 | Widget B | 30.00 |
| 3 | Widget C | 15.00 |

### Tax Rate:

| TaxRate |
| - |
| 0.07 |

You want to create a custom function that calculates the total price (price + tax) for each item.

## LAMBDA Formula

To achieve this, you would define a LAMBDA function as follows:

```
=LAMBDA(price, tax, price * (1 + tax))(A2, TaxRate!A1)
```

In this formula:

- `price` is the first parameter representing the price of the item.
- `tax` is the second parameter representing the tax rate.
- `price * (1 + tax)` is the formula that calculates the total price including tax.
- `(A2, TaxRate!A1)` are the arguments passed to the LAMBDA function, where `A2` is the cell containing the price of the item and `TaxRate!A1` is the cell containing the tax rate.

## Result of the Formula

When you apply the LAMBDA formula to the Items Table, the output would look like this:

| ItemID | ItemName | Price | Total Price |
| - | - | - | - |
| 1 | Widget A | 20.00 | 21.40 |
| 2 | Widget B | 30.00 | 32.10 |
| 3 | Widget C | 15.00 | 16.05 |

In this case, the LAMBDA function calculates the total price for each item by applying the tax rate.

## Why Use LAMBDA?

LAMBDA is beneficial because it allows you to create custom functions that can simplify complex calculations. By encapsulating formulas into reusable functions, you can reduce redundancy and improve the readability of your spreadsheets. Additionally, LAMBDA functions can be combined with other functions, enhancing your data manipulation capabilities.

## Key Takeaways:

- **LAMBDA**: A powerful function that allows you to create custom functions in Google Sheets.
- **Reusable**: Encapsulate complex formulas into simple, reusable functions.
- **Improves Readability**: Simplifies your spreadsheets by reducing formula complexity.
- **Common Use Cases**: Ideal for calculations that require repetitive formulas, such as financial modeling, data analysis, and reporting.

LAMBDA is an essential feature for anyone looking to enhance their spreadsheet skills, providing a powerful way to streamline calculations and improve data management.

Happy spreadsheeting!

## Example use case

You have a sales data table with product IDs in Column A and sales figures in Column B. Use the LAMBDA function to create a custom formula that calculates the total sales for a specific product ID, streamlining data analysis and reporting.

## Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

[Create Free Account](https://betteranalyst.com/signup)[Try Formula Generator](https://betteranalyst.com/excel-ai)

## Google Sheets how-to guides

- [How To Multiply In Google Sheets](https://betteranalyst.com/google-sheets/how-to-multiply-in-google-sheets)
- [How To Password Protect An Google Sheets File](https://betteranalyst.com/google-sheets/how-to-password-protect-an-google-sheets-file)
- [How To Remove Blank Rows In Google Sheets](https://betteranalyst.com/google-sheets/how-to-remove-blank-rows-in-google-sheets)
- [How To Remove Duplicates In Google Sheets](https://betteranalyst.com/google-sheets/how-to-remove-duplicates-in-google-sheets)
- [How To Separate Names In Google Sheets](https://betteranalyst.com/google-sheets/how-to-separate-names-in-google-sheets)
- [How To Sort In Google Sheets](https://betteranalyst.com/google-sheets/how-to-sort-in-google-sheets)
- [How To Split Cells In Google Sheets](https://betteranalyst.com/google-sheets/how-to-split-cells-in-google-sheets)
- [How To Strikethrough In Google Sheets](https://betteranalyst.com/google-sheets/how-to-strikethrough-in-google-sheets)

## Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

## Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

1. [01ChatGPTOpen a balanced comparison prompt in ChatGPT.](https://chatgpt.com/?prompt=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
2. [02ClaudeOpen the same research prompt in Claude.](https://claude.ai/new?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
3. [03PerplexityResearch the comparison with linked web sources.](https://www.perplexity.ai/search?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.
