Skip to content
v0.1.0latest release21 skills2 categories3 sub-categories22 tested scripts68 reference docsContact us

excel-formulas

Write error-free Excel formulas — syntax rules, cell references, math, logical, lookup (VLOOKUP, INDEX/MATCH, XLOOKUP), text, date/time and conditional aggregation (SUMIFS, COUNTIFS) with error handling. Use when the user asks for an Excel or spreadsheet formula, a calculation in a workbook, or help fixing #REF!, #VALUE!, #N/A or #NAME? errors.

Productivity / Excelv1.0.0Updated OCT 20 20263 references1 script

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:

excel
=SUM(range)
=AVERAGE(range)
=COUNT(range)

Conditional:

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

Lookup:

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

Conditional Sum/Count:

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

Error Handling:

excel
=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

Scripts

Lint formulas before giving them to the user:

bash
python scripts/check_formula.py '=IFERROR(VLOOKUP(A2,Data!A:C,3,FALSE),"Not found")'
python scripts/check_formula.py --file formulas.txt --json

Reports missing =, unbalanced parentheses, unterminated strings, smart quotes, nesting over 64 levels, unknown function names (#NAME? risk), volatile functions and VLOOKUP/HLOOKUP calls without an explicit match mode. Exit code 1 means at least one formula has errors.

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 excel-advanced-formulas skill.

More in Excel