Excel piecewise scoring

From XuShuwenn/RedAct · View interactive version

Excel piecewise scoring is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Build spreadsheet score columns from piecewise polynomial formulas with clamping, by copying required source columns, inserting formulas, rounding to 3 decimals, and verifying results.

How to use this skill

Skill file

Spreadsheet Piecewise Polynomial Scoring

A reusable workflow for spreadsheet tasks that require:

This pattern applies to powerlifting Dots-like coefficients and other sports/benchmarks that use group-specific polynomial scoring functions based on attributes such as sex, class, or division.

When to Use

Activate this skill when you need to:

Core Workflow

1) Understand the official formula

score = Total × scale / P(clamped_input)

where P(x) = a4·x^4 + b3·x^3 + c2·x^2 + d1·x + e0

2) Inspect the source sheet

3) Create and populate the target sheet

=IF(OR(Sex="G1", Sex="Alt1"), ROUND(Totalscale/(a4_m(BWc)^4 + b3_m(BWc)^3 + c2_m(BWc)^2 + d1_m(BWc) + e0_m), 3), ROUND(Totalscale/(a4_f(BWc)^4 + b3_f(BWc)^3 + c2_f(BWc)^2 + d1_f(BWc) + e0_f), 3))

where BWc is the clamped bodyweight expression and constants are filled from the official spec.

4) Recalculate formulas

5) Verify results independently

Verification Checklist (Success Criteria)

Common Pitfalls and How to Avoid Them

Optional Script Usage

Use the helper to generate a robust Excel IF formula string for a row that:

Example workflow:

1) Decide cell references for one row, e.g.,

2) Prepare a JSON config with your group mappings, coefficients, and clamps (see script help below).

3) Generate the formula string with the script and write it into the corresponding cell for that row, then fill down.

See scripts/piecewise_poly_excel.py for details.

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.