hydr0pon1c/skills-on-the-fly/183-8
Claude Code and agent skill by hydr0pon1c/skills-on-the-fly
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install hydr0pon1c/skills-on-the-fly/183-8SKILL.md
The same SKILL.md was published earlier as hydr0pon1c/skills-on-the-fly/183-8.
SKILL.md
When to use
Use this skill when the task requires calculating a weighted average across multiple columns in a spreadsheet, where each column’s values are averaged using a corresponding weight column (e.g., a generation or quantity column). The target context provides:
- The exact cell range where formulas should be written (here J3:L6).
- A sample file with data tables; the weight column is typically numeric and adjacent to the value columns.
- The instruction explicitly asks to write formulas (not static numbers) in specific cells.
Before acting, the agent must:
- Open the spreadsheet and identify the weight column (e.g., a column containing “Sum of Gen.” or “unit count”) and the value columns to be averaged.
- Confirm that all data rows cover the same fiscal years (or categories) to ensure the weighted average is computed correctly.
- Verify the exact output range (e.g., J3:L6) and any surrounding context (headers, existing formulas) to avoid overwriting unintended cells.
Possible Failure Modes
- Misidentifying the weight column: Using a non-numeric or unrelated column as the weight (e.g., using a date or a percentage) instead of the column explicitly tied to generation or quantity.
- Ignoring the “only write formulas” constraint: Placing static numeric results instead of formulas, or overwriting cells outside the allowed range.
- Incorrect range references: Using absolute vs relative references incorrectly so that copying formulas fails. For weighted averages, the weight column and value columns should be locked with absolute references (e.g.,
$C$3:$C$6) while the output cell rows can be relative. - Using wrong aggregation function: Using a simple AVERAGE or SUM where a sum of products divided by sum of weights is required. The standard weighted average formula is
=SUMPRODUCT(values, weights)/SUM(weights). - Off-by-one errors in row ranges: Including header rows or excluding the last data row because of misreading the spreadsheet content.
- Forgetting to handle division by zero: The formula should guard against cases where the sum of weights is zero (e.g., using
IFERROR). - Sheet name mismatch: Referring to a sheet by a different name than exists in the workbook (e.g., using 'Sheet1' when the actual sheet is 'Data').
Possible procedures
- Inspect the spreadsheet structure
- Read all rows and columns in the relevant sheet. Identify the exact column letters for the weight (e.g., column C) and the value columns (e.g., J, K, L).
- Note the row range of data (exclude headers). Assume data starts at row 3 and ends at row 6 (or whatever the answer_position implies).
- Check for any existing formulas or values in the output range that need to be replaced.
- Construct the weighted average formula
- For each value column, use:
=SUMPRODUCT(value_range, weight_range) / SUM(weight_range)
- Lock the weight range with absolute references (e.g.,
$C$3:$C$6) so the formula can be copied across columns and rows if needed. - Use
IFERRORto handle division by zero:
=IFERROR(SUMPRODUCT(...)/SUM(...), 0) or leave blank ("").
- Place formulas in the designated range
- For cell J3: formula referencing values in column J data range (e.g.,
J3:J6? Actually the value column is J, but the output is in J3. Wait: The output range is J3:L6. That means J3 is the first output cell for the first weighted average. The data for the first weighted average is presumably in columns? Let's clarify:
Usually, if data rows are 3-6, and we need weighted averages for columns J, K, L, then the formulas go in J3, K3, L3? But the instruction says "write formulas in J3:L6". That suggests multiple rows of weighted averages (maybe for different fiscal years or categories). So we need to determine the grouping key. Inspect the data to see if there are repeating groups (e.g., FY) that require separate weighted averages per group.
- Adjust for grouped calculations
- If the data contains multiple fiscal years (e.g., 2021-2022, 2020-2021), each with multiple rows, the weighted average must be calculated per group. Use
SUMIFSorSUMPRODUCTwith criteria. - Example:
=SUMPRODUCT((FY_range=FY_cell)*(value_range)*(weight_range))/SUMPRODUCT((FY_range=FY_cell)*(weight_range)). - Ensure the FY cell reference is relative (or mixed) so it works across rows.
- Verify and test
- After writing formulas, open the saved workbook and check that all cells in J3:L6 contain formulas (not values) and that the formulas evaluate correctly (e.g., no
#DIV/0!unless intentionally handled). - Compare one manually computed weighted average (using a small subset) to ensure formula correctness.
Verification Checklist
- [ ] Output range is exactly as specified: J3:L6 (or I3:L7) – check that formulas occupy only these cells and no others are modified.
- [ ] All cells contain formulas, not static numbers – open the saved file and verify the
.valueis a string starting with=. - [ ] Weight column is correctly identified – confirm the weight column used in SUMPRODUCT matches the column that contains generation/quantity (e.g., “Sum of Gen. (kwh) DAY”).
- [ ] Ranges are correct – data rows cover exactly the intended rows (e.g., 3:6) and exclude headers.
- [ ] Division by zero handled – either
IFERRORor a condition to prevent#DIV/0!. - [ ] Sheet name matches exactly – the sheet used in any formula references (if cross-sheet) matches the actual sheet name (case-sensitive).
- [ ] No unintended side effects – cells outside the answer range (e.g., other columns, formatting) remain unchanged.
- [ ] Recovery check – if the initial attempt produced errors, re-inspect the data for hidden rows, merged cells, or non-numeric weight values that cause formula failures.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingprompt_optimizer/runs/example/spreadsheet/task_skills/183-8/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hydr0pon1c/skills-on-the-fly/183-8)