LAMBDA · Financial
Markup LAMBDA
xl.markup returns profit as a share of the cost. A $50 price on a $30 cost is a markup of 2/3, about 66.67%.
Syntax =xl.markup(price, cost)
=LAMBDA(price, cost,
LET(
profit, price - cost,
IF(cost=0, NA(), profit / cost)
)
)Arguments
| Name | Required | What to pass |
|---|---|---|
| price | Required | The selling price. |
| cost | Required | The cost. Zero returns #N/A. |
Examples
Twenty dollars of profit on a thirty-dollar cost
=xl.markup(50, 30)Result 66.67%
| A | B | |
|---|---|---|
| 1 | Price | 50 |
| 2 | Cost | 30 |
| 3 | Markup | 0.6667 |
xl.markup divides profit by the cost. The $50 item that cost $30 has $20 of profit, and 20 / 30 is two thirds. A percent format shows about 66.67%. The margin on that item is 40%, because margin divides by the price.
Use this when a buyer says “mark it up 50%” and means half of the cost, not half of the shelf price.
Add it to the workbook
Copy the formula in the block above, including the line breaks. Choose Formulas, Name Manager, New. Set the name to xl.markup, the scope to Workbook, and paste into Refers to. Excel Labs can do the same step: open the Advanced Formula Environment, add that name, and save it back to the workbook. A cell then calls =xl.markup(...).
The name needs Microsoft 365, Excel 2024, or Excel for the web. Excel 2021 returns #NAME? for LAMBDA even when it already has XLOOKUP, FILTER, or LET.
How it works
Profit is price minus cost. The divisor is the cost. A zero cost returns #N/A. The stored result of the sample is the repeating fraction 0.666…, not a rounded 0.67, until you format or ROUND it.
Limits
A negative cost is accepted and will flip the sign. That is rarely a markup you meant to publish. The function does not add the markup back onto the cost. Price equals cost times (1 + markup).