Problem
The xl formula evaluator doesn't support the LET function, which is commonly used for complex calculations with named variables.
Error
When attempting to use LET formulas, xl fails silently or produces errors:
=LET(
current_item, E2,
current_order, A2,
total_stock, SUMIFS(stock_qtys, stock_items, current_item),
...
result
)
The formula was not evaluated and the output file wasn't created.
What is LET?
LET (introduced in Excel 365/2021) allows defining named variables within a formula:
=LET(
name1, value1,
name2, value2,
calculation_using_names
)
Why This Matters
LET is increasingly used by LLMs when generating complex Excel formulas because:
- It improves readability
- Avoids repetition (DRY principle)
- Can improve performance by computing values once
- Makes complex FIFO/allocation logic more maintainable
Example Use Case
From SpreadsheetBench task 2768 (FIFO inventory allocation), the agent attempted:
=LET(
current_item, E2,
current_order, A2,
stock_qtys, Sheet2!$D$2:$D$7,
stock_items, Sheet2!$C$2:$C$7,
total_stock, SUMIFS(stock_qtys, stock_items, current_item),
... more variables for FIFO logic ...
result
)
Suggested Implementation
- Parse LET as a special function that creates a local scope
- Evaluate name-value pairs sequentially
- Substitute variable names in the final expression
- Return the result of the final expression
Priority
Medium - LET is increasingly common in modern Excel workflows and LLM-generated formulas.
Related
Problem
The xl formula evaluator doesn't support the
LETfunction, which is commonly used for complex calculations with named variables.Error
When attempting to use LET formulas, xl fails silently or produces errors:
The formula was not evaluated and the output file wasn't created.
What is LET?
LET (introduced in Excel 365/2021) allows defining named variables within a formula:
Why This Matters
LET is increasingly used by LLMs when generating complex Excel formulas because:
Example Use Case
From SpreadsheetBench task 2768 (FIFO inventory allocation), the agent attempted:
Suggested Implementation
Priority
Medium - LET is increasingly common in modern Excel workflows and LLM-generated formulas.
Related