Using Lambdas in Petroleum Office
Petroleum Office functions expect field units — psi, degF, bbl/d, ft. If you work in SI, every call means converting the inputs on the way in and the result on the way out.
The lambda catalog exists to do that for you. Each lambda is a named formula you add to your workbook that takes SI inputs, calls the matching Petroleum Office function underneath, and hands back an SI result.
What a Lambda Is Here
A LAMBDA is Excel's own way of defining a reusable formula and calling it by name. Every lambda in this catalog follows one pattern: it is the SI counterpart of an existing function, named after it with .SI on the end.
So where the field-unit call is:
=PO.ESP.BrakeHP.FromRate(Q_bbld, TDH_ft, SG, efficiency)
the SI version takes cubic metres per day and metres, and returns kilowatts instead of horsepower:
=PO.ESP.BrakeHP.FromRate.SI(Q_m3d, TDH_m, SG, efficiency)
Underneath, that lambda converts each argument, calls the field-unit function, and converts the answer back. Nothing is recalculated differently — it is the same correlation with the unit handling moved off your worksheet.
Lambdas need the add-in. Because each one calls a Petroleum Office function internally, a workbook using them still requires Petroleum Office installed. They save you the unit conversions, not the dependency.
Opening the Lambda Manager
- Go to the Petroleum Office tab in the ribbon
- In the Library group, click the Lambdas button
The Library pane opens with the Lambdas tab in front. It is a task pane that stays open while you work, and it shares the pane with the Functions and Blueprints tabs.
Browsing Lambdas
The pane has its own toolbar row above the list:
- Tree — browse the curated hierarchy, grouped by discipline. This is the same hierarchy used by the lambda catalog on this website
- List — browse a flat list of every lambda instead
- Expand all / Collapse all — open or close every branch of the tree at once
- Search — type in the search box to filter by name or description
Select a lambda and the detail panel shows its Formula — the full LAMBDA definition, including the conversions it performs — along with its Parameters and a Workflow description.
Reading the formula is worth a minute the first time: it shows exactly which unit each argument is expected in, which is the thing most likely to trip you up.
Adding a Lambda to Your Workbook
Select the lambda you want and click Add to Workbook.
This writes it into the workbook as a defined name. Afterwards you will find it in Formulas → Name Manager, with the LAMBDA definition in the Refers to box. Some catalog entries add more than one name, because a lambda can build on helper lambdas; those are added alongside it so the formula resolves.
If a name already exists in the workbook, a message lists the conflicts before anything is written, so you can continue or cancel. Worth reading rather than clicking through — continuing replaces a definition your sheets may already depend on.
Once added, call it by name in any cell, exactly as in the example above. The detail panel shows the exact name; use that rather than inferring it from the catalog title.
Working with an Added Lambda
- The workbook owns it. The definition is stored in the file, so copies of the workbook carry it. Using it in a new workbook means adding it again there.
- It appears in Name Manager. Rename or delete it there like any other defined name — and as with a renamed range, formulas referencing the old name break.
- The definition is editable. The formula in Refers to is the lambda; changing it changes every use in that workbook.
- Auditing works normally. Lambdas are plain defined names, so Excel's formula auditing and precedent tracing behave as usual.
Tips
- Match the units to the name. A
.SIlambda expects SI inputs. Passing field units produces a number that looks plausible and is wrong — the most common mistake with this catalog - Use the field-unit function directly if your data is already in psi and degF; the lambda would only convert twice for nothing
- Browse before you open Excel — the full catalog is on this website at /lambdas, where each lambda has its own page showing the formula and parameters
- For one-off conversions, the Unit Converter is simpler than adding a lambda
- Lambdas and functions mix freely in the same workbook and the same formula