Excel Expert
Overview
This skill covers the full spectrum of professional Excel use—from essential lookup and aggregation formulas through pivot tables, data validation, and conditional formatting to dynamic dashboard construction. It provides ready-to-use formula patterns, step-by-step instructions for advanced features, and a comprehensive quick-reference formula library so you can solve real business spreadsheet problems fast.
When to Use
- You need a specific Excel formula and aren't sure of the syntax
- A VLOOKUP or INDEX/MATCH is returning an error
- You want to build a pivot table or dynamic summary
- You need to apply conditional formatting rules across a dataset
- You're building a dashboard, budget model, or tracking sheet in Excel
- You want to validate data entry (dropdowns, date ranges, numeric constraints)
When NOT to Use
- Writing Excel VBA/macro code (use a VBA skill)
- Migrating an Excel model to Python, SQL, or another tool
- Designing a production database (Excel is not a database)
- Analyzing datasets with more than ~500,000 rows (use pandas or SQL)
Quick Reference
| Formula |
Syntax |
Use Case |
| VLOOKUP |
=VLOOKUP(lookup, table, col_index, 0) |
Look up a value in a table (left-to-right only) |
| XLOOKUP |
=XLOOKUP(lookup, lookup_range, return_range, "Not found") |
Modern replacement for VLOOKUP; any direction |
| INDEX/MATCH |
=INDEX(return_col, MATCH(lookup, lookup_col, 0)) |
Flexible lookup; left-to-right or right-to-left |
| SUMIF |
=SUMIF(range, criteria, sum_range) |
Sum values meeting one condition |
| SUMIFS |
=SUMIFS(sum_range, range1, crit1, range2, crit2) |
Sum values meeting multiple conditions |
| COUNTIF |
=COUNTIF(range, criteria) |
Count cells meeting one condition |
| COUNTIFS |
=COUNTIFS(range1, crit1, range2, crit2) |
Count cells meeting multiple conditions |
| IF |
=IF(condition, value_if_true, value_if_false) |
Conditional logic |
| IFS |
=IFS(cond1, val1, cond2, val2, TRUE, default) |
Multiple conditions (Excel 2019+) |
| IFERROR |
=IFERROR(formula, "Error text") |
Catch and handle formula errors |
| AVERAGEIF |
=AVERAGEIF(range, criteria, avg_range) |
Average values meeting a condition |
| MAXIFS |
=MAXIFS(max_range, criteria_range, criteria) |
Max value meeting a condition (Excel 2019+) |
| TEXT |
=TEXT(value, "format_code") |
Format a number/date as a string |
| LEFT/MID/RIGHT |
=LEFT(text, n) |
Extract characters from a string |
| CONCATENATE / & |
=A1&" "&B1 |
Join text values |
| LEN |
=LEN(text) |
Count characters in a string |
| TRIM |
=TRIM(text) |
Remove leading/trailing/extra spaces |
| UNIQUE |
=UNIQUE(range) |
Distinct values (Excel 365/2021) |
| FILTER |
=FILTER(array, condition, "No results") |
Filter a range dynamically (Excel 365) |
| SORT |
=SORT(range, sort_index, -1) |
Sort a range dynamically (Excel 365) |
Instructions
Step 1: Lookup Formulas — VLOOKUP vs XLOOKUP vs INDEX/MATCH
VLOOKUP — simple but limited (lookup column must be leftmost):
=VLOOKUP(E2, $A$2:$C$100, 3, 0)
E2 = what to look up
$A$2:$C$100 = table range (lock with $ for copying)
3 = return the 3rd column of the table
0 = exact match (always use 0 for exact match)
XLOOKUP — modern, flexible (Excel 365/2021):
=XLOOKUP(E2, A:A, C:C, "Not found", 0)
- Can look left or right
- Built-in "not found" default value
- No column index needed
INDEX/MATCH — most flexible, works in all Excel versions:
=INDEX(C:C, MATCH(E2, A:A, 0))
INDEX(C:C, ...) = return from column C
MATCH(E2, A:A, 0) = find the row position of E2 in column A
- Wrap with IFERROR:
=IFERROR(INDEX(C:C, MATCH(E2, A:A, 0)), "Not found")
Two-way lookup (row and column):
=INDEX($B$2:$F$10, MATCH($A14, $A$2:$A$10, 0), MATCH(B$13, $B$1:$F$1, 0))
Step 2: Conditional Aggregation (SUMIFS, COUNTIFS, AVERAGEIF)
SUMIFS — total sales for "West" region in "Q3":
=SUMIFS(D:D, B:B, "West", C:C, "Q3")
SUMIFS with date range — sales in January 2024:
=SUMIFS(D:D, A:A, ">="&DATE(2024,1,1), A:A, "<="&DATE(2024,1,31))
COUNTIFS — count orders over $1,000 from new customers:
=COUNTIFS(E:E, "New", D:D, ">1000")
Running total (cumulative sum):
=SUM($D$2:D2)
(The first $D$2 is anchored; copy down the column to get a running total.)
Step 3: Nested IF and IFS
Nested IF — grade banding:
=IF(B2>=90,"A", IF(B2>=80,"B", IF(B2>=70,"C", IF(B2>=60,"D","F"))))
IFS (cleaner, Excel 2019+):
=IFS(B2>=90,"A", B2>=80,"B", B2>=70,"C", B2>=60,"D", TRUE,"F")
Combining with IFERROR:
=IFERROR(VLOOKUP(A2, Products!$A:$C, 3, 0), "Product not found")
Step 4: Pivot Tables (Step-by-Step)
- Click anywhere in your data range
- Insert → PivotTable → choose "New Worksheet"
- Drag fields:
- Rows: dimension to group by (e.g., Region, Product)
- Columns: secondary dimension (e.g., Quarter)
- Values: metric to aggregate (e.g., Revenue → Sum)
- Filters: optional slicer (e.g., Year)
- Right-click a value field → Value Field Settings → choose Sum/Count/Average/Max
- Right-click a date field → Group → select Month/Quarter/Year
- Add a Slicer: PivotTable Analyze → Insert Slicer for interactive filtering
Refresh data: Right-click pivot → Refresh (or Ctrl+Alt+F5 for all pivots)
GETPIVOTDATA formula to pull a specific cell:
=GETPIVOTDATA("Revenue", $A$3, "Region", "West", "Quarter", "Q3")
Step 5: Conditional Formatting
- Select the data range (e.g., D2:D100)
- Home → Conditional Formatting
Heat map (color scale):
- Conditional Formatting → Color Scales → choose 3-color scale
- Min = red, Mid = yellow, Max = green
Highlight above-average values:
- Conditional Formatting → Top/Bottom Rules → Above Average
Custom formula rule (highlight entire row if status = "Late"):
- Conditional Formatting → New Rule → "Use a formula"
- Formula:
=$E2="Late" ($ locks the column, not the row)
- Apply to:
$A$2:$F$100
Data bars (mini bar chart inside cells):
- Conditional Formatting → Data Bars → choose a style
Step 6: Data Validation
- Select the target cell(s)
- Data → Data Validation
Dropdown list:
- Allow: List
- Source:
West,East,North,South (comma-separated) or a named range =RegionList
Date range:
- Allow: Date
- Data: between
- Start:
=TODAY()-365, End: =TODAY()
Whole number with error message:
- Allow: Whole number, Between 1 and 100
- Error Alert tab → set Title and Message
Custom formula validation (email format check):
- Allow: Custom
- Formula:
=ISNUMBER(FIND("@",A2))
Step 7: Build a Dynamic Dashboard
- Create a Data sheet with raw data
- Create a Summary sheet with SUMIFS/COUNTIFS formulas referencing Data
- Use Form Controls (Developer → Insert → Combo Box) linked to a cell for filter selection
- Reference the linked cell in formulas:
=SUMIFS(Data!D:D, Data!B:B, $G$1) where G1 = selected region
- Build charts from Summary data; they update automatically as G1 changes
- Add slicers connected to pivot tables for click-to-filter interactivity
Examples
Example 1: Build a Dynamic Sales Dashboard
Input: Raw sales data sheet with columns: Date | Region | Product | Revenue | Units
Dashboard formulas in Summary sheet:
# G1 = selected region (from dropdown)
Total Revenue (selected region):
=SUMIF(Data!B:B, G1, Data!D:D)
Total Revenue (all regions):
=SUM(Data!D:D)
Region Share %:
=SUMIF(Data!B:B, G1, Data!D:D) / SUM(Data!D:D)
Month-over-Month revenue (current month):
=SUMIFS(Data!D:D, Data!B:B, G1, Data!A:A, ">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1))
Top Product in Region:
=INDEX(Data!C:C, MATCH(MAXIFS(Data!D:D, Data!B:B, G1), Data!D:D, 0))
Steps:
- Insert Combo Box (Developer → Insert → Combo Box), link to cell G1
- Fill source range with region list
- Wire formulas above to G1
- Insert line chart and bar chart referencing summary rows
- Format numbers: select cells → Ctrl+1 → Number → Currency
Output: Dashboard that updates all metrics and charts when user selects a region from the dropdown.
Example 2: Fix a Broken VLOOKUP
Input: =VLOOKUP(A2, B:D, 2, 0) returning #N/A for values that exist in the table.
Diagnosis checklist:
- Trailing spaces:
=VLOOKUP(TRIM(A2), B:D, 2, 0) — fixes hidden whitespace
- Number vs text mismatch: A2 is text "1234" but column B has number 1234
- Fix:
=VLOOKUP(VALUE(A2), B:D, 2, 0) or =VLOOKUP(TEXT(A2,"0"), B:D, 2, 0)
- Wrong match type: last argument is
1 (approximate match) instead of 0
- Fix: always use
0 for exact match
- Table range not including the lookup column: VLOOKUP needs lookup column as the LEFTMOST column
- Fix: reorder table or switch to XLOOKUP/INDEX-MATCH
- After fixing: wrap with IFERROR to handle remaining misses gracefully:
=IFERROR(VLOOKUP(TRIM(A2), $B$1:$D$500, 2, 0), "Not found")
Output: Working lookup with a user-friendly "Not found" instead of #N/A.
Best Practices
- Always lock table references with $ in lookups:
$A$2:$C$100 (breaks on copy otherwise)
- Use named ranges (Formulas → Name Manager) for tables referenced in many formulas
- Prefer XLOOKUP over VLOOKUP if your Excel version supports it (2021/365)
- Use IFERROR around every lookup formula to handle mismatches gracefully
- Keep raw data on a separate "Data" sheet; never mix calculations into raw data rows
- Format numbers as Currency/Percentage in cells, not in the formula text
- Freeze panes (View → Freeze Panes) on dashboards to keep headers visible
Common Mistakes
- Using
1 (approximate match) instead of 0 (exact match) in VLOOKUP
- Forgetting to anchor the table range with $ when copying formulas down
- Circular references: a cell that refers to itself (check Formulas → Error Checking)
- Mixing text and numbers in the same column (causes SUMIF/VLOOKUP to miss rows)
- Deleting rows in source data without updating named ranges
- Using whole-column references (A:A) in very large files—can slow calculation
- Hard-coding dates instead of using
=TODAY() or =DATE(2024,1,1) for flexibility
Tips & Tricks
Ctrl+Shift+Enter for array formulas (older Excel); Excel 365 handles arrays natively
Ctrl+T converts a range to a Table—formulas auto-expand as you add rows
- Name your pivot table slicers to connect them to multiple pivots (right-click slicer → Report Connections)
=UNIQUE(A:A) + =SORT() + =FILTER() are Excel 365's "spill" functions—they expand automatically
- Press
F4 to toggle absolute/relative references while editing a formula
Ctrl+`` (backtick) toggles between showing formulas and values in all cells
- Use
=INDIRECT("Sheet2!A"&ROW()) to dynamically reference cells across sheets
Related Skills
1---2name: excel-expert3description: Use this skill when working with Excel or Google Sheets formulas, pivot tables, data validation, conditional formatting, or building spreadsheet-based tools. Trigger phrases: 'Excel formula for', 'how do I VLOOKUP', 'build a pivot table', 'conditional formatting rule', 'create a dashboard in Excel'. Not for writing VBA macros, building Python/SQL alternatives to Excel, or migrating data out of spreadsheets.4license: MIT5---67# Excel Expert89## Overview10This skill covers the full spectrum of professional Excel use—from essential lookup and aggregation formulas through pivot tables, data validation, and conditional formatting to dynamic dashboard construction. It provides ready-to-use formula patterns, step-by-step instructions for advanced features, and a comprehensive quick-reference formula library so you can solve real business spreadsheet problems fast.1112## When to Use13- You need a specific Excel formula and aren't sure of the syntax14- A VLOOKUP or INDEX/MATCH is returning an error15- You want to build a pivot table or dynamic summary16- You need to apply conditional formatting rules across a dataset17- You're building a dashboard, budget model, or tracking sheet in Excel18- You want to validate data entry (dropdowns, date ranges, numeric constraints)1920## When NOT to Use21- Writing Excel VBA/macro code (use a VBA skill)22- Migrating an Excel model to Python, SQL, or another tool23- Designing a production database (Excel is not a database)24- Analyzing datasets with more than ~500,000 rows (use pandas or SQL)2526## Quick Reference27| Formula | Syntax | Use Case |28|---------|--------|----------|29| VLOOKUP | `=VLOOKUP(lookup, table, col_index, 0)` | Look up a value in a table (left-to-right only) |30| XLOOKUP | `=XLOOKUP(lookup, lookup_range, return_range, "Not found")` | Modern replacement for VLOOKUP; any direction |31| INDEX/MATCH | `=INDEX(return_col, MATCH(lookup, lookup_col, 0))` | Flexible lookup; left-to-right or right-to-left |32| SUMIF | `=SUMIF(range, criteria, sum_range)` | Sum values meeting one condition |33| SUMIFS | `=SUMIFS(sum_range, range1, crit1, range2, crit2)` | Sum values meeting multiple conditions |34| COUNTIF | `=COUNTIF(range, criteria)` | Count cells meeting one condition |35| COUNTIFS | `=COUNTIFS(range1, crit1, range2, crit2)` | Count cells meeting multiple conditions |36| IF | `=IF(condition, value_if_true, value_if_false)` | Conditional logic |37| IFS | `=IFS(cond1, val1, cond2, val2, TRUE, default)` | Multiple conditions (Excel 2019+) |38| IFERROR | `=IFERROR(formula, "Error text")` | Catch and handle formula errors |39| AVERAGEIF | `=AVERAGEIF(range, criteria, avg_range)` | Average values meeting a condition |40| MAXIFS | `=MAXIFS(max_range, criteria_range, criteria)` | Max value meeting a condition (Excel 2019+) |41| TEXT | `=TEXT(value, "format_code")` | Format a number/date as a string |42| LEFT/MID/RIGHT | `=LEFT(text, n)` | Extract characters from a string |43| CONCATENATE / & | `=A1&" "&B1` | Join text values |44| LEN | `=LEN(text)` | Count characters in a string |45| TRIM | `=TRIM(text)` | Remove leading/trailing/extra spaces |46| UNIQUE | `=UNIQUE(range)` | Distinct values (Excel 365/2021) |47| FILTER | `=FILTER(array, condition, "No results")` | Filter a range dynamically (Excel 365) |48| SORT | `=SORT(range, sort_index, -1)` | Sort a range dynamically (Excel 365) |4950## Instructions5152### Step 1: Lookup Formulas — VLOOKUP vs XLOOKUP vs INDEX/MATCH5354**VLOOKUP** — simple but limited (lookup column must be leftmost):55```56=VLOOKUP(E2, $A$2:$C$100, 3, 0)57```58- `E2` = what to look up59- `$A$2:$C$100` = table range (lock with $ for copying)60- `3` = return the 3rd column of the table61- `0` = exact match (always use 0 for exact match)6263**XLOOKUP** — modern, flexible (Excel 365/2021):64```65=XLOOKUP(E2, A:A, C:C, "Not found", 0)66```67- Can look left or right68- Built-in "not found" default value69- No column index needed7071**INDEX/MATCH** — most flexible, works in all Excel versions:72```73=INDEX(C:C, MATCH(E2, A:A, 0))74```75- `INDEX(C:C, ...)` = return from column C76- `MATCH(E2, A:A, 0)` = find the row position of E2 in column A77- Wrap with IFERROR: `=IFERROR(INDEX(C:C, MATCH(E2, A:A, 0)), "Not found")`7879**Two-way lookup** (row and column):80```81=INDEX($B$2:$F$10, MATCH($A14, $A$2:$A$10, 0), MATCH(B$13, $B$1:$F$1, 0))82```8384### Step 2: Conditional Aggregation (SUMIFS, COUNTIFS, AVERAGEIF)8586**SUMIFS** — total sales for "West" region in "Q3":87```88=SUMIFS(D:D, B:B, "West", C:C, "Q3")89```9091**SUMIFS with date range** — sales in January 2024:92```93=SUMIFS(D:D, A:A, ">="&DATE(2024,1,1), A:A, "<="&DATE(2024,1,31))94```9596**COUNTIFS** — count orders over $1,000 from new customers:97```98=COUNTIFS(E:E, "New", D:D, ">1000")99```100101**Running total** (cumulative sum):102```103=SUM($D$2:D2)104```105(The first `$D$2` is anchored; copy down the column to get a running total.)106107### Step 3: Nested IF and IFS108109**Nested IF** — grade banding:110```111=IF(B2>=90,"A", IF(B2>=80,"B", IF(B2>=70,"C", IF(B2>=60,"D","F"))))112```113114**IFS** (cleaner, Excel 2019+):115```116=IFS(B2>=90,"A", B2>=80,"B", B2>=70,"C", B2>=60,"D", TRUE,"F")117```118119**Combining with IFERROR**:120```121=IFERROR(VLOOKUP(A2, Products!$A:$C, 3, 0), "Product not found")122```123124### Step 4: Pivot Tables (Step-by-Step)1251. Click anywhere in your data range1262. **Insert → PivotTable** → choose "New Worksheet"1273. Drag fields:128 - **Rows**: dimension to group by (e.g., Region, Product)129 - **Columns**: secondary dimension (e.g., Quarter)130 - **Values**: metric to aggregate (e.g., Revenue → Sum)131 - **Filters**: optional slicer (e.g., Year)1324. Right-click a value field → **Value Field Settings** → choose Sum/Count/Average/Max1335. Right-click a date field → **Group** → select Month/Quarter/Year1346. Add a Slicer: **PivotTable Analyze → Insert Slicer** for interactive filtering135136**Refresh data**: Right-click pivot → Refresh (or Ctrl+Alt+F5 for all pivots)137138**GETPIVOTDATA formula** to pull a specific cell:139```140=GETPIVOTDATA("Revenue", $A$3, "Region", "West", "Quarter", "Q3")141```142143### Step 5: Conditional Formatting1441. Select the data range (e.g., D2:D100)1452. **Home → Conditional Formatting**146147**Heat map (color scale):**148- Conditional Formatting → Color Scales → choose 3-color scale149- Min = red, Mid = yellow, Max = green150151**Highlight above-average values:**152- Conditional Formatting → Top/Bottom Rules → Above Average153154**Custom formula rule** (highlight entire row if status = "Late"):155- Conditional Formatting → New Rule → "Use a formula"156- Formula: `=$E2="Late"` ($ locks the column, not the row)157- Apply to: `$A$2:$F$100`158159**Data bars** (mini bar chart inside cells):160- Conditional Formatting → Data Bars → choose a style161162### Step 6: Data Validation1631. Select the target cell(s)1642. **Data → Data Validation**165166**Dropdown list:**167- Allow: List168- Source: `West,East,North,South` (comma-separated) or a named range `=RegionList`169170**Date range:**171- Allow: Date172- Data: between173- Start: `=TODAY()-365`, End: `=TODAY()`174175**Whole number with error message:**176- Allow: Whole number, Between 1 and 100177- Error Alert tab → set Title and Message178179**Custom formula validation** (email format check):180- Allow: Custom181- Formula: `=ISNUMBER(FIND("@",A2))`182183### Step 7: Build a Dynamic Dashboard1841. Create a **Data** sheet with raw data1852. Create a **Summary** sheet with SUMIFS/COUNTIFS formulas referencing Data1863. Use **Form Controls** (Developer → Insert → Combo Box) linked to a cell for filter selection1874. Reference the linked cell in formulas: `=SUMIFS(Data!D:D, Data!B:B, $G$1)` where G1 = selected region1885. Build charts from Summary data; they update automatically as G1 changes1896. Add **slicers** connected to pivot tables for click-to-filter interactivity190191## Examples192193### Example 1: Build a Dynamic Sales Dashboard194**Input:** Raw sales data sheet with columns: `Date | Region | Product | Revenue | Units`195196**Dashboard formulas in Summary sheet:**197```198# G1 = selected region (from dropdown)199200Total Revenue (selected region):201=SUMIF(Data!B:B, G1, Data!D:D)202203Total Revenue (all regions):204=SUM(Data!D:D)205206Region Share %:207=SUMIF(Data!B:B, G1, Data!D:D) / SUM(Data!D:D)208209Month-over-Month revenue (current month):210=SUMIFS(Data!D:D, Data!B:B, G1, Data!A:A, ">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1))211212Top Product in Region:213=INDEX(Data!C:C, MATCH(MAXIFS(Data!D:D, Data!B:B, G1), Data!D:D, 0))214```215216**Steps:**2171. Insert Combo Box (Developer → Insert → Combo Box), link to cell G12182. Fill source range with region list2193. Wire formulas above to G12204. Insert line chart and bar chart referencing summary rows2215. Format numbers: select cells → Ctrl+1 → Number → Currency222223**Output:** Dashboard that updates all metrics and charts when user selects a region from the dropdown.224225---226227### Example 2: Fix a Broken VLOOKUP228**Input:** `=VLOOKUP(A2, B:D, 2, 0)` returning `#N/A` for values that exist in the table.229230**Diagnosis checklist:**2311. **Trailing spaces**: `=VLOOKUP(TRIM(A2), B:D, 2, 0)` — fixes hidden whitespace2322. **Number vs text mismatch**: A2 is text "1234" but column B has number 1234233 - Fix: `=VLOOKUP(VALUE(A2), B:D, 2, 0)` or `=VLOOKUP(TEXT(A2,"0"), B:D, 2, 0)`2343. **Wrong match type**: last argument is `1` (approximate match) instead of `0`235 - Fix: always use `0` for exact match2364. **Table range not including the lookup column**: VLOOKUP needs lookup column as the LEFTMOST column237 - Fix: reorder table or switch to XLOOKUP/INDEX-MATCH2385. **After fixing**: wrap with IFERROR to handle remaining misses gracefully:239 ```240 =IFERROR(VLOOKUP(TRIM(A2), $B$1:$D$500, 2, 0), "Not found")241 ```242243**Output:** Working lookup with a user-friendly "Not found" instead of #N/A.244245## Best Practices246- Always lock table references with $ in lookups: `$A$2:$C$100` (breaks on copy otherwise)247- Use named ranges (Formulas → Name Manager) for tables referenced in many formulas248- Prefer XLOOKUP over VLOOKUP if your Excel version supports it (2021/365)249- Use IFERROR around every lookup formula to handle mismatches gracefully250- Keep raw data on a separate "Data" sheet; never mix calculations into raw data rows251- Format numbers as Currency/Percentage in cells, not in the formula text252- Freeze panes (View → Freeze Panes) on dashboards to keep headers visible253254## Common Mistakes255- Using `1` (approximate match) instead of `0` (exact match) in VLOOKUP256- Forgetting to anchor the table range with $ when copying formulas down257- Circular references: a cell that refers to itself (check Formulas → Error Checking)258- Mixing text and numbers in the same column (causes SUMIF/VLOOKUP to miss rows)259- Deleting rows in source data without updating named ranges260- Using whole-column references (A:A) in very large files—can slow calculation261- Hard-coding dates instead of using `=TODAY()` or `=DATE(2024,1,1)` for flexibility262263## Tips & Tricks264- `Ctrl+Shift+Enter` for array formulas (older Excel); Excel 365 handles arrays natively265- `Ctrl+T` converts a range to a Table—formulas auto-expand as you add rows266- Name your pivot table slicers to connect them to multiple pivots (right-click slicer → Report Connections)267- `=UNIQUE(A:A)` + `=SORT()` + `=FILTER()` are Excel 365's "spill" functions—they expand automatically268- Press `F4` to toggle absolute/relative references while editing a formula269- `Ctrl+`` ` (backtick) toggles between showing formulas and values in all cells270- Use `=INDIRECT("Sheet2!A"&ROW())` to dynamically reference cells across sheets271272## Related Skills273- [data-analyst](../../data/data-analyst/SKILL.md)274- [data-cleaner](../../data/data-cleaner/SKILL.md)275- [dashboard-designer](../../data/dashboard-designer/SKILL.md)