Bird
Raised Fist0
Excelspreadsheet~8 mins

LAMBDA for custom functions in Excel - Dashboard Guide

Choose your learning style10 modes available
Dashboard Mode - LAMBDA for custom functions
Dashboard Goal

This dashboard helps you calculate custom metrics easily by creating your own reusable formulas using Excel's LAMBDA function. It shows how to define a custom function to calculate the average sales per product and then use it across the data.

Sample Data
ProductSales Q1Sales Q2Sales Q3
Apples100150130
Bananas8090100
Cherries120110140
Dates909585
Elderberries706075
Dashboard Components
  • Custom Function Definition (Named Formula): AvgSales = LAMBDA(q1, q2, q3, (q1 + q2 + q3) / 3)
    Defines a reusable function to calculate average sales from three quarters.
  • Average Sales per Product: Formula in cell E2 and down:
    =AvgSales(B2, C2, D2)
    Calculates average sales for each product using the custom function.
  • Total Average Sales: Formula in cell E8:
    =AVERAGE(E2:E6)
    Shows the overall average sales across all products.
Dashboard Layout
+-----------------------------+
|        Sales Data           |
| +-------------------------+ |
| | Product | Q1 | Q2 | Q3  | |
| |---------|----|----|-----| |
| | Apples  |100 |150 |130  | |
| | Bananas | 80 | 90 |100  | |
| | Cherries|120 |110 |140  | |
| | Dates   | 90 | 95 | 85  | |
| | Elderb. | 70 | 60 | 75  | |
| +-------------------------+ |
| Avg Sales per Product (Col E)|
| E2: =AvgSales(B2,C2,D2)      |
| ...                          |
| E8: Total Avg Sales: =AVERAGE(E2:E6) |
+-----------------------------+
Interactivity

You can change any sales number in columns B, C, or D. The average sales per product and total average sales update automatically because the custom function AvgSales recalculates with new inputs.

Adding filters or slicers on Product names can help focus on specific products, updating the total average accordingly if you adjust the formula to consider filtered data.

Self Check

If you add a filter to show only products with Sales Q1 greater than 90, which products remain and what is the new total average sales?

Answer: Products remaining are Apples (100) and Cherries (120). Dates (90) is not greater than 90, so it is excluded. The average sales recalculated for these two products using the AvgSales function will update the total average sales accordingly.

Key Result
Dashboard demonstrating how to create and use a custom average sales function with Excel's LAMBDA.

Practice

(1/5)
1. What does the LAMBDA function in Excel allow you to do?
easy
A. Convert text to numbers
B. Create your own custom formulas with parameters
C. Automatically sort data in a column
D. Create charts from data ranges

Solution

  1. Step 1: Understand the purpose of LAMBDA

    LAMBDA lets you create custom formulas that can take inputs and return results, like your own mini-functions.
  2. Step 2: Compare with other options

    Sorting, converting text, and creating charts are done by other Excel features, not LAMBDA.
  3. Final Answer:

    Create your own custom formulas with parameters -> Option B
  4. Quick Check:

    LAMBDA = custom formulas [OK]
Hint: LAMBDA = your own formula with inputs [OK]
Common Mistakes:
  • Thinking LAMBDA sorts or formats data
  • Confusing LAMBDA with built-in functions like SORT
  • Assuming LAMBDA creates charts
2. Which of these is the correct syntax to define a LAMBDA function that adds two numbers x and y?
easy
A. =LAMBDA(x, y, x + y)
B. =LAMBDA(x + y)
C. =LAMBDA(x, y; x + y)
D. =LAMBDA(x, y, x - y)

Solution

  1. Step 1: Check LAMBDA syntax

    LAMBDA syntax is =LAMBDA(parameter1, parameter2, ..., calculation). So =LAMBDA(x, y, x + y) is correct.
  2. Step 2: Identify errors in other options

    =LAMBDA(x + y) misses parameters, C uses wrong separator (;), D subtracts instead of adding.
  3. Final Answer:

    =LAMBDA(x, y, x + y) -> Option A
  4. Quick Check:

    Correct LAMBDA syntax uses commas and parameters [OK]
Hint: LAMBDA needs parameters, commas, and a formula [OK]
Common Mistakes:
  • Using semicolons instead of commas
  • Omitting parameters
  • Mixing up addition and subtraction
3. Given the formula =LAMBDA(x, y, x * y)(3, 4), what is the result shown in the cell?
medium
A. 7
B. 34
C. 12
D. Error

Solution

  1. Step 1: Understand the LAMBDA call

    The LAMBDA takes two inputs x and y, then returns x * y. Here, x=3 and y=4.
  2. Step 2: Calculate the multiplication

    3 multiplied by 4 equals 12.
  3. Final Answer:

    12 -> Option C
  4. Quick Check:

    3 * 4 = 12 [OK]
Hint: Multiply inputs inside LAMBDA to get result [OK]
Common Mistakes:
  • Adding instead of multiplying
  • Concatenating numbers as text
  • Expecting an error from correct syntax
4. What is wrong with this LAMBDA formula? =LAMBDA(x, y, x + y(2, 3))
medium
A. Incorrect function call syntax inside LAMBDA
B. Missing closing parenthesis
C. Parameters x and y are not defined
D. LAMBDA cannot add numbers

Solution

  1. Step 1: Analyze the formula structure

    The formula tries to add x + y(2, 3), but y is a parameter, not a function, so y(2, 3) is invalid.
  2. Step 2: Identify the syntax error

    You cannot call parameters like functions inside LAMBDA. The correct call is outside the LAMBDA definition.
  3. Final Answer:

    Incorrect function call syntax inside LAMBDA -> Option A
  4. Quick Check:

    Parameters are values, not callable functions [OK]
Hint: Don't call parameters like functions inside LAMBDA [OK]
Common Mistakes:
  • Trying to call parameters as functions
  • Confusing LAMBDA parameters with named functions
  • Ignoring parentheses placement
5. You want to create a reusable LAMBDA function named DOUBLE that doubles any number input. Which steps correctly create and use this function?
hard
A. Write =DOUBLE(5) without defining DOUBLE anywhere.
B. Write =LAMBDA(x, x*2)(5) directly in a cell without naming it.
C. Define DOUBLE as =LAMBDA(x, x+2) in Name Manager, then use =DOUBLE(5).
D. Define DOUBLE as =LAMBDA(x, x*2) in Name Manager, then use =DOUBLE(5) in a cell.

Solution

  1. Step 1: Define the LAMBDA function correctly

    In Name Manager, create a name DOUBLE with formula =LAMBDA(x, x*2) to double input x.
  2. Step 2: Use the named function in cells

    After defining, use =DOUBLE(5) in any cell to get 10.
  3. Final Answer:

    Define DOUBLE as LAMBDA(x, x*2) and call DOUBLE(5) -> Option D
  4. Quick Check:

    Named LAMBDA + call = reusable function [OK]
Hint: Name LAMBDA in Name Manager, then call by name [OK]
Common Mistakes:
  • Using wrong formula (x+2 instead of x*2)
  • Calling named function without defining it
  • Trying to use LAMBDA without naming for reuse
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard