Excel LAMBDA Function
Chala mitrano — today we learn LAMBDA. It lets you build your own reusable formula, like a tiny custom function, without VBA.
चला मित्रांनो — आज LAMBDA शिकू. VBA न वापरता स्वतःची reusable formula बनवता येते.
चलो दोस्तों — आज LAMBDA सीखते हैं। VBA के बिना अपनी reusable formula बना सकते हैं।
Purpose
Create a custom, reusable calculation. You name parameters, write the formula once, and call it like a normal function (often stored in Name Manager).
Return value
Whatever your LAMBDA body returns — a number, text, array, or error — depending on the formula you wrote inside.
Syntax
Arguments
| Argument | Required? | Description |
|---|---|---|
parameter | Optional (usually used) | A name for a value you will pass in (example: price, qty, rate). |
calculation | Required | The formula that uses those parameter names. This is the last argument. |
Version
Microsoft 365. Not in Excel 2019 or older. Pair with Name Manager to create a lasting custom function for the workbook.
How to use — Why → What → How
Why: The same GST or tip math is pasted in twenty cells. One change means twenty edits. Interviews also ask if you know modern Excel 365 tools.
What: LAMBDA defines parameters and one calculation. You can test it in a cell, then save it as a defined name (example: NetPay).
How — numbered steps:
- In an empty cell, type a test LAMBDA and call it at once:
=LAMBDA(x, x*1.18)(100). - Check the result (118). Fix the math if needed.
- Select Formulas → Name Manager → New.
- Name it (example:
AddGST). In Refers to, paste=LAMBDA(amount, amount*1.18). - In any sheet type
=AddGST(1000)and press Enter.
Ravindra Bagale's Tip
Friends, always test the LAMBDA in a cell with (args) at the end before saving the name. A broken Name Manager entry is harder to debug.
Ravindra Bagale's Tip – मराठी
मित्रांनो, Name Manager मध्ये save करण्यापूर्वी सेलमध्ये (args) देऊन LAMBDA टेस्ट करा.
Ravindra Bagale's Tip – हिंदी
दोस्तों, Name Manager में सेव करने से पहले सेल में (args) देकर LAMBDA टेस्ट करो।
Ravindra Bagale's Tip
Keep parameter names short and clear: price, qty, city — not x1, x2, tmp.
Ravindra Bagale's Tip – मराठी
Parameter नावे छोटी आणि स्पष्ट ठेवा: price, qty — x1, tmp नको.
Ravindra Bagale's Tip – हिंदी
Parameter नाम छोटे और साफ़ रखो: price, qty — x1, tmp नहीं।
Worked examples
1) Inline call — add 18% GST (₹)
Amit Deshmukh sells a mixer for ₹2,000 in Nashik. Add GST in one shot.
| Item | Price (₹) |
|---|---|
| Mixer | 2000 |
Result: 2360
What it means: Parameter amount is 2000; calculation multiplies by 1.18.
2) Two parameters — line total
Priya packs 12 boxes at ₹85 each.
Result: 1020
What it means: qty=12, price=85; product is the line total.
3) UK tip helper (£)
Emma Wright in Leeds adds a 10% tip on a £42.50 bill.
Result: 46.75
What it means: Same LAMBDA pattern works with pounds; only the numbers change.
4) Text helper — clean city label
Build a short label from city and code.
Result: NAS-NK-09
What it means: LAMBDA can return text, not only numbers.
5) Saved name idea (after Name Manager)
After you save AddGST as =LAMBDA(amount, amount*1.18):
Result: (depends on A2) — for 2000 → 2360
What it means: The workbook now has a reusable custom function.
Common errors and fixes
Notes and tips
- LAMBDA pairs well with MAP, REDUCE, SCAN, BYROW and BYCOL.
- For helpers you use every day, store them in Name Manager.
- Keep the calculation short. Long logic → break into LET inside the LAMBDA.
Related functions
LET, MAP, REDUCE, SCAN, BYROW, BYCOL, MAKEARRAY
Practice tasks (10)
- Task 1. Write an inline LAMBDA that triples a number and call it with 15.Hint: LAMBDA(x, x*3)(15)
- Task 2. Make a two-parameter LAMBDA for qty × price; call with 8 and 120.Hint: last argument is the calculation.
- Task 3. Add 5% to a £80 bill using LAMBDA.Hint: bill*(1+0.05)
- Task 4. Build LAMBDA(city, LEFT(city,3)) and call with "Pune".Hint: result should be Pun
- Task 5. Explain in one line why =LAMBDA(x,x+1) alone shows #CALC! or looks unfinished.Hint: it was not called.
- Task 6. Create a Name Manager name Net18 for amount*1.18 and test with 500.Hint: Refers to starts with =LAMBDA
- Task 7. Write LAMBDA that returns "Big" if amount≥1000 else "Small"; test 850 and 1200.Hint: use IF inside.
- Task 8. Use your Net18 name on cell B2 instead of a typed number.Hint: =Net18(B2)
- Task 9. List two Excel versions where LAMBDA will not work.Hint: think 2016 / 2019.
- Task 10. Bonus: LAMBDA with three parameters: qty, price, discount_rate → qty*price*(1-discount_rate). Test 10, 50, 0.1.Hint: result 450
Quick quiz
Answers: Q1=True, Q2=last, Q3=#CALC!, Q4=Name Manager.