Xlsx 2d lookup weighted stats

From XuShuwenn/RedAct · View interactive version

Xlsx 2d lookup weighted stats is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Populate Excel blocks via two-key (row+column) lookups and compute ratios, summary stats, and GDP-weighted means without altering formatting.

How to use this skill

Skill file

Excel 2D Lookup + Weighted Stats

Reusable workflow for spreadsheet tasks that require:

This skill emphasizes formula-driven solutions (INDEX/MATCH or XLOOKUP/MATCH) and strict preservation of workbook formatting.

When to Use

Core Workflow

1) Inspect the Workbook Structure

2) Fill Blocks with Two-Key INDEX/MATCH

=INDEX(SourceSheet!$VALS_TOP_LEFT:$VALS_BOTTOM_RIGHT,

MATCH($RowKeyCell, SourceSheet!$ROWKEY_COL_TOP:$ROWKEY_COL_BOTTOM, 0),

MATCH(ColKeyCell, SourceSheet!$COLKEY_ROW_LEFT:$COLKEY_ROW_RIGHT, 0))

3) Compute Derived Ratios

=((ExportsCell − ImportsCell) / GDPCell) × 100

4) Add Summary Statistics per Year

5) Compute Weighted Mean (e.g., GDP-weighted)

=SUMPRODUCT(NetExportsPctRange, GDPRng) / SUM(GDPRng)

6) Recalculate and Validate

Verification Checklist

Common Pitfalls and How to Avoid Them

Optional Script Usage

Use the provided helper to generate robust 2D INDEX/MATCH formulas and common aggregations without altering formatting. It accepts generic ranges and produces formulas with correct absolute/mixed references.

Example (pseudocode steps):

See scripts/xlsx_2d_tools.py for reusable functions.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.