AgentSkillsCN

Formulas

公式

SKILL.md

XLSX Formulas

Standard Excel formula writing skill covering syntax, functions, error handling, and common patterns.

Overview

This skill provides guidance for writing error-free Excel formulas with proper syntax and best practices. Use when creating spreadsheet calculations, data analysis formulas, or any formula-based operations in Excel.

What's Covered

TopicDescription
Syntax RulesEqual sign, parentheses, separators, cell references
ValidationPre-flight checklist before outputting formulas
Error HandlingCommon errors and prevention strategies
Function CategoriesMath, Logical, Lookup, Text, Date/Time, Statistical
Formula PatternsTemplates for common calculations

Function Categories Quick Reference

CategoryKey FunctionsUse Cases
MathSUM, AVERAGE, ROUND, ABSArithmetic operations
LogicalIF, AND, OR, IFS, SWITCHConditional logic
LookupVLOOKUP, INDEX, MATCH, XLOOKUPData retrieval
TextCONCAT, LEFT, RIGHT, MID, TRIMString manipulation
Date/TimeTODAY, NOW, DATE, DATEDIFDate calculations
StatisticalCOUNT, COUNTIF, SUMIF, SUMIFSConditional aggregation
Dynamic ArrayFILTER, SORT, UNIQUE, SEQUENCEModern spill formulas

Common Formula Patterns

Aggregation:

code
=SUM(range)
=AVERAGE(range)
=COUNT(range)

Conditional:

code
=IF(condition, true_value, false_value)
=IFS(cond1, val1, cond2, val2, TRUE, default)

Lookup:

code
=XLOOKUP(lookup, search_range, return_range)
=INDEX(range, MATCH(value, lookup_range, 0))

Conditional Sum/Count:

code
=SUMIF(range, criteria, sum_range)
=SUMIFS(sum_range, range1, criteria1, range2, criteria2)
=COUNTIF(range, criteria)

Error Handling:

code
=IFERROR(formula, fallback_value)
=IFNA(lookup_formula, "Not Found")

Validation Checklist

Before outputting any formula:

  • Starts with =
  • Parentheses are balanced
  • Function names are English
  • Arguments use commas (not semicolons)
  • Cell references are valid (A1 notation)
  • No circular references
  • Data types match function expectations

Error Prevention

ErrorCauseSolution
#REF!Invalid referenceVerify cell exists
#VALUE!Type mismatchCheck data types
#DIV/0!Division by zeroUse IFERROR wrapper
#N/ANot foundAdd fallback value
#NAME?Unknown functionCheck spelling

Skill Files

FileContent
Formulas.mdComplete syntax rules, templates, and patterns
functions-reference.mdDetailed function documentation by category
examples.mdProduction-ready formula examples

When to Use

Use this skill when:

  • Writing Excel formulas for calculations
  • Creating lookup or conditional logic
  • Aggregating data with criteria
  • Handling formula errors
  • Building formula templates

For advanced features (LAMBDA, LET, GROUPBY), see the advanced-formulas skill.