agentic-net-examples / manage-formulas
AGENTS.md1 starsChanged 29 days agoMITView on GitHub
Create focused examples for authoring, editing, copying, inspecting, auditing, and organizing Excel formulas with Aspose.Cells for .NET. Follow ../AGENTS.md. This category manages formula expressions and relationships. Use calculate-formulas when evaluation, calculation options, custom engines, monitoring, or calculation performance is the dominant intent. In scope: standard/local/R1C1 formulas, shared and array formulas, dynamic arrays, table calculated columns, named ranges, external references, precedents/dependents, formula search/replacement, auditing, validation, locking formula cells, and calculation-mode coordination after edits. Each example must identify formula type, target cell/range,…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository32 other files it gives its agents.
- Aspose.Cells for .NET Product AgentAGENTS.md
- calculate-formulas/AGENTS.mdAGENTS.md
- cells-data/AGENTS.mdAGENTS.md
- comments-and-notes/AGENTS.mdAGENTS.md
- conversion/AGENTS.mdAGENTS.md
- document-properties/AGENTS.mdAGENTS.md
- encryption-and-protection/AGENTS.mdAGENTS.md
- format-cells/AGENTS.mdAGENTS.md
- globalization-and-localization/AGENTS.mdAGENTS.md
- macro-project/AGENTS.mdAGENTS.md
- manage-workbook/AGENTS.mdAGENTS.md
- managing-ranges/AGENTS.mdAGENTS.md
- open-workbook/AGENTS.mdAGENTS.md
- pivot-table/AGENTS.mdAGENTS.md
- queries-and-connections/AGENTS.mdAGENTS.md
- rows-and-columns/AGENTS.mdAGENTS.md
- save-workbook/AGENTS.mdAGENTS.md
- slicer/AGENTS.mdAGENTS.md
- smart-markers/AGENTS.mdAGENTS.md
- sparkline/AGENTS.mdAGENTS.md
- timeline/AGENTS.mdAGENTS.md
- workbook-merger/AGENTS.mdAGENTS.md
- working-with-charts/AGENTS.mdAGENTS.md
- working-with-html/AGENTS.mdAGENTS.md
- working-with-images/AGENTS.mdAGENTS.md
- working-with-json/AGENTS.mdAGENTS.md
- working-with-pdf/AGENTS.mdAGENTS.md
- working-with-shapes/AGENTS.mdAGENTS.md
- working-with-tables/AGENTS.mdAGENTS.md
- working-with-worksheets/AGENTS.mdAGENTS.md
- xml-maps/AGENTS.mdAGENTS.md
- llms.txtllms.txt
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Create focused examples for authoring, editing, copying, inspecting, auditing, and organizing Excel formulas with Aspose.Cells for .NET.
- Distinctive: line 45
Use valid sheet quoting and absolute/relative references deliberately.
- Distinctive: line 46
Do not perform naive string replacement when formula token boundaries, quoted strings, or external links can change meaning.
- Distinctive: line 47
Verify supported functions and dynamic-array behavior for the installed package.
- Distinctive: line 48
Treat external workbook links and user-provided formulas as untrusted input.
- Distinctive: line 49
Do not label Excel functions "deprecated" without an authoritative source and compatibility rationale.
- Distinctive: line 74
Use stable, valid Excel names and avoid collisions with cell references.
- Very specific: line 76
Update RefersTo with valid formula syntax and verify dependent formulas after recalculation.
- Distinctive: line 77
Treat precedent/dependent results as potentially spanning worksheets/workbooks.
- Distinctive: line 78
Do not claim a complete dependency graph from an API that returns only direct relationships.
- Distinctive: line 83
Do not overwrite spill ranges or table-managed columns accidentally.
- Distinctive: line 84
Verify every resulting cell or the expected spilled range.
- Distinctive: line 85
Use the API designed for the formula type instead of copying text manually.
- Distinctive: line 97
Never fetch external workbooks or execute arbitrary code from formula text.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Formula Management Agent Instructions
Mission and category boundary
Create focused examples for authoring, editing, copying, inspecting, auditing, and organizing Excel formulas with Aspose.Cells for .NET. Follow ../AGENTS.md.
This category manages formula expressions and relationships. Use calculate-formulas when evaluation, calculation options, custom engines, monitoring, or calculation performance is the dominant intent.
Scope
In scope: standard/local/R1C1 formulas, shared and array formulas, dynamic arrays, table calculated columns, named ranges, external references, precedents/dependents, formula search/replacement, auditing, validation, locking formula cells, and calculation-mode coordination after edits.
Canonical API map
| Intent | APIs |
| Assign standard formula | Cell.Formula or verified SetFormula overload |
| Localized formula | Cell.FormulaLocal |
| R1C1 formula | Version-supported R1C1 property/method |
| Array formula | SetArrayFormula / dynamic-array APIs verified for the package |
| Shared formula | SetSharedFormula |
| Named range | NameCollection, Name.RefersTo, range APIs |
| Audit dependencies | GetPrecedents, GetDependents, calculation-specific dependency APIs as documented |
| Evaluate after editing | Workbook.CalculateFormula from the calculation workflow |
Hard rules
- Begin formula strings with
=and use documented invariant syntax unlessFormulaLocalis explicitly required. - Distinguish formula text from calculated value.
- Recalculate before asserting a result, but keep calculation mechanics secondary here.
- Use valid sheet quoting and absolute/relative references deliberately.
- Do not perform naive string replacement when formula token boundaries, quoted strings, or external links can change meaning.
- Verify supported functions and dynamic-array behavior for the installed package.
- Treat external workbook links and user-provided formulas as untrusted input.
- Do not label Excel functions "deprecated" without an authoritative source and compatibility rationale.
Canonical pattern
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Cells["A1"].PutValue(10);
worksheet.Cells["A2"].PutValue(20);
worksheet.Cells["A3"].Formula = "=SUM(A1:A2)";
workbook.CalculateFormula();
double result = worksheet.Cells["A3"].DoubleValue;
if (Math.Abs(result - 30.0) > 0.000001)
{
throw new InvalidOperationException("Formula result was not 30.");
}
workbook.Save("managed-formula.xlsx");Named ranges and dependencies
- Use stable, valid Excel names and avoid collisions with cell references.
- State workbook versus worksheet scope.
- Update
RefersTowith valid formula syntax and verify dependent formulas after recalculation. - Treat precedent/dependent results as potentially spanning worksheets/workbooks.
- Do not claim a complete dependency graph from an API that returns only direct relationships.
Array, shared, and table formulas
- State target range dimensions and anchor cell.
- Do not overwrite spill ranges or table-managed columns accidentally.
- Verify every resulting cell or the expected spilled range.
- Use the API designed for the formula type instead of copying text manually.
Example contract
Each example must identify formula type, target cell/range, expression, dependencies, primary API, expected formula text/value, and output. Use deterministic data and concise action-first filenames.
Metadata and the opening comment should answer one intent such as "set SUM formula in C#," "create named range formula," or "find formula precedents." Avoid keyword stuffing.
Security and validation
- Validate user-supplied formulas against an allowlist/policy appropriate to the application.
- Audit external links, volatile functions, hidden-sheet references, and formula injection risks.
- Never fetch external workbooks or execute arbitrary code from formula text.
- Compile, run, verify stored formula text, calculate when required, assert values/dependencies, save/reopen, and confirm persistence.
Reject invented functions/APIs, unsafe text replacement, broken references, unsupported compatibility claims, and results read before calculation.
Related knowledge
- Category overview
- Calculate formulas
- Ranges
- Tables
- Official formula documentation
Definition of done
The example is done when formula type, syntax, target, dependencies, security assumptions, stored expression, calculated result where relevant, and persistence are explicit and verified.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

