Suppose several sheets in your workbook calculate a price including tax. You can give that calculation a name, then use =PriceWithTax(A2,B2) wherever you need it. Excel's LAMBDA function lets you do this without VBA: test the calculation in a cell, save its definition under a workbook name, and supply the price and rate each time you call it.
We'll use one pricing rule throughout: multiply the net price by one plus the tax rate, then round the result to two decimal places. That rounding rule belongs to this example; choose the rule your own pricing process requires.
Microsoft lists LAMBDA for Microsoft 365 on Windows and Mac, Excel for the web, and Excel 2024 on Windows and Mac. The naming instructions below follow its desktop guidance. See Microsoft's LAMBDA documentation for availability and the documented setup process.
Start with a calculation you can check
You can follow along in the LAMBDA example workbook, which includes the completed Prices and Reuse sheets and the saved PriceWithTax function. To build it yourself, start with a blank workbook and follow the steps below.
Create a sheet named Prices. Enter these headings in A1:F1:
| A | B | C | D | E | F |
|---|---|---|---|---|---|
| Net price | Tax rate | Ordinary | Inline LAMBDA | Named function | Expected |
Enter the following inputs in columns A and B, and the expected results in column F. Leave C:E empty for now.
| Row | A: Net price | B: Tax rate | F: Expected |
|---|---|---|---|
| 2 | 80 | 7.5% | 86 |
| 3 | 99.95 | 20% | 119.94 |
| 4 | 0 | 20% | 0 |
| 5 | 19.99 | 7.5% | 21.49 |
Enter rates as numeric percentages, including the % sign. For example, 7.5% has the underlying value 0.075. Entering the number 7.5 instead means a rate of 750%; the formula won't correct that input for you.
In C2, enter the ordinary formula:
=ROUND(A2*(1+B2),2)FormulaThe expected result is 86: 80 × 1.075 = 86. Copy C2 down through C5 and compare the results with column F.
The ROUND function changes the calculated value to two decimal places. For row 5, 19.99 × 1.075 = 21.48925, which rounds to 21.49. Formatting a cell to display two decimals alone wouldn't change that underlying value.
Test the LAMBDA in a worksheet cell
In D2, enter:
=LAMBDA(net,rate,ROUND(net*(1+rate),2))(A2,B2)FormulaThis should also return 86. Copy D2 through D5; columns C and D should agree on every row.

Read the formula in two parts. LAMBDA(net,rate,ROUND(net*(1+rate),2)) defines a calculation with two input names, called parameters. The final (A2,B2) supplies their values and runs the calculation.
The inputs match by position:
| Supplied value | Parameter | Meaning in row 2 |
|---|---|---|
| A2 | net | Net price of 80 |
| B2 | rate | Tax rate of 0.075 |
Inside the calculation, net takes the place of A2 and rate takes the place of B2. These parameter names aren't worksheet cell addresses. They mean whichever values you supply for that particular call.
Order matters. The price goes first and the rate second; swapping A2 and B2 changes the calculation, even though both inputs are numbers.
Save the definition as PriceWithTax
Once the inline results agree with the ordinary formula, save the definition under a name. Microsoft's documented menu paths are Formulas > Name Manager on Windows and Formulas > Define Name on Mac. Use the naming controls to create this workbook name:
| Setting | Value |
|---|---|
| Name | PriceWithTax |
| Scope | Workbook |
| Comment | Return a tax-inclusive price rounded to two decimals. Inputs: net price, tax rate as a decimal or percentage. |
For Refers to, enter:
=LAMBDA(net,rate,ROUND(net*(1+rate),2))Formula
Save the name. Notice that the definition ends after ROUND and LAMBDA close. Leave off (A2,B2) here. Those were the test inputs in D2; each worksheet call will supply its own inputs.
Back on Prices, enter this in E2:
=PriceWithTax(A2,B2)FormulaCopy E2 down through E5. The ordinary formula, inline LAMBDA, and named function should now give the same results:
| Row | Ordinary | Inline LAMBDA | Named function |
|---|---|---|---|
| 2 | 86 | 86 | 86 |
| 3 | 119.94 | 119.94 | 119.94 |
| 4 | 0 | 0 | 0 |
| 5 | 21.49 | 21.49 | 21.49 |
If you display these cells with two decimal places, 86 appears as 86.00 and zero appears as 0.00. They are still the same numeric results.
Call the function on another sheet
Add a sheet named Reuse. Enter 125 in A2 and 8% in B2. In C2, enter:
=PriceWithTax(A2,B2)FormulaThe expected result is 135, because 125 × 1.08 = 135. This call uses A2 and B2 on Reuse, even though you created the name while working on Prices.

That's why the saved definition uses net and rate rather than fixed references to the original price cells. Change Prices!A2 and its row should recalculate, while Reuse!C2 should remain 135. Each call supplies its own values.
Workbook scope makes the name available across this workbook. It doesn't install PriceWithTax in every workbook you open. To use it in a separate workbook, define it there too. Save this workbook as an .xlsx file, then close and reopen it to check that the name and both sheets' results remain available.
Fix the two common LAMBDA mistakes
#CALC! when you enter the definition in a cell
The saved definition is valid in the name's Refers to field, but entering it alone in an ordinary worksheet cell produces #CALC!:
=LAMBDA(net,rate,ROUND(net*(1+rate),2))FormulaThat cell defines a function without calling it. For a worksheet test, append (A2,B2) as in D2. After saving the definition under PriceWithTax, call the name as in E2.
#VALUE! when the number of inputs is wrong
PriceWithTax requires two inputs. This call supplies only one:
=PriceWithTax(A2)FormulaThe expected error is #VALUE!. Supply both the net price and the rate: =PriceWithTax(A2,B2). Microsoft's documentation identifies incorrect argument counts as a LAMBDA error; the Excel formula error guide covers other errors you may encounter.
Keep input checks separate from the calculation
PriceWithTax applies arithmetic to the values you give it. It doesn't decide whether a price or rate is appropriate for your worksheet. For example, a net price of −10 with a 20% rate produces −12. That may suit a credit, but the function won't reject it when your sheet requires positive prices.
Likewise, entering 7.5 as the rate for a price of 80 produces 680, because the calculation becomes 80 × (1 + 7.5). Check that the rate is stored as 7.5% or 0.075 when you expect 86. A short function name makes the formula easier to reuse; the input values still determine the answer. If you only need to name a repeated calculation inside one formula, start with the LET walkthrough.