Excel financial calculations
[COLM'26] SkillLearnBench is the first benchmark for evaluating continual learning methods that automatically generate agent skills.
npx -y skills add cxcscmu/SkillLearnBench --skill excel-financial-calculationsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its author says it does
Copied from the file, not written here
Calculate financial metrics in Excel including percentages of GDP, percentage changes, and weighted averages. Use this skill when working with economic data, calculating net exports as percentage of GDP, or deriving financial ratios from raw data.
SKILL.md
3.6 KB, as published. Nobody here has run it
Excel Financial Calculations
Overview
Common financial calculations in spreadsheets require understanding how to properly handle percentages, ratios, and weighted aggregations.
Net Exports as Percentage of GDP
Formula structure:
=( Net Exports / GDP ) * 100
This gives you the percentage in the typical display format (e.g., 5.2 rather than 0.052).
Example:
=( H35 / G35 ) * 100
Where:
- H35 = Net Exports value
- G35 = GDP value
- Result displays as percentage (e.g., 5.2)
Key point: Multiply by 100 to display as percentage rather than decimal.
Percentage of Total
Similar structure:
=( Component / Total ) * 100
Weighted Average (SUMPRODUCT)
Use SUMPRODUCT for weighted averages where each value has an associated weight.
Formula:
=SUMPRODUCT(values, weights) / SUM(weights)
Or if you want the result as a percentage (multiplied by 100):
=(SUMPRODUCT(values, weights) / SUM(weights)) * 100
Example - Weighted mean of net exports as % of GDP:
=SUMPRODUCT(C35:C40, B35:B40) / SUM(B35:B40) * 100
Where:
- C35:C40 = net exports as % of GDP for each country
- B35:B40 = weight for each country (typically population, GDP, or another measure of size)
- Result = weighted average percentage
Breaking it down:
- SUMPRODUCT(C35:C40, B35:B40) = sum of (each % × its weight)
- SUM(B35:B40) = total of all weights
- Divide to get weighted average
- Multiply by 100 if displaying as percentage
Percentage Rounding
To round percentages to one decimal place:
=ROUND( calculation, 1)
Combined with your calculation:
=ROUND( (value / total) * 100, 1)
Or:
=ROUND( SUMPRODUCT(values, weights) / SUM(weights) * 100, 1)
Statistical Functions with Percentages
When calculating statistics on percentage data:
=MIN(range) * 100 or =ROUND(MIN(range) * 100, 1)
=MAX(range) * 100 or =ROUND(MAX(range) * 100, 1)
=MEDIAN(range) * 100 or =ROUND(MEDIAN(range) * 100, 1)
=AVERAGE(range) * 100 or =ROUND(AVERAGE(range) * 100, 1)
=QUARTILE(range, 1) * 100 for 25th percentile
=QUARTILE(range, 3) * 100 for 75th percentile
Or with PERCENTILE function:
=PERCENTILE(range, 0.25) * 100 for 25th percentile
=PERCENTILE(range, 0.75) * 100 for 75th percentile
Order of Operations
When combining calculations:
- Do the lookup/retrieval
- Calculate the percentage (divide then multiply by 100)
- Apply rounding
- For aggregations, apply weights before averaging
Pattern:
=ROUND( (raw_value / denominator) * 100, 1)
Common Pitfalls
- Forgetting × 100 - Results display as 0.05 instead of 5
- Dividing by zero - Use IF to check:
=IF(denominator=0, 0, numerator/denominator*100) - Wrong order - Round after all calculations, not before
- Mixing decimal and percentage forms - Be consistent in your data
- SUMPRODUCT with wrong ranges - Ensure weights and values arrays have same dimensions
Example Complete Flow
For net exports as % of GDP by country with weighted mean:
Cell H35: =ROUND( (H32 / H31) * 100, 1) [first country, net exports % of GDP]
Cell H36: =ROUND( (H33 / H32) * 100, 1) [second country...]
...
Cell H41: =ROUND( SUMPRODUCT(H35:H40, E35:E40) / SUM(E35:E40) * 100, 1) [weighted mean]
Where E35:E40 contains the weights (e.g., GDP, population, etc.)