Skip to content

Add PERCENTRANK.INC, MODE.MULT, FREQUENCY and PROB functions (HF-421, HF-424, HF-425, HF-428) - #1818

Open
marcin-kordas-hoc wants to merge 3 commits into
developfrom
feat/hf-stats2-percentrank-inc-modemult-frequency-prob
Open

marcin-kordas-hoc wants to merge 3 commits into
developfrom
feat/hf-stats2-percentrank-inc-modemult-frequency-prob

Conversation

@marcin-kordas-hoc

Copy link
Copy Markdown
Collaborator

Summary

Adds four statistical functions: PERCENTRANK.INC (with its PERCENTRANK alias), MODE.MULT, FREQUENCY and PROB (HF-421, HF-424, HF-425, HF-428).

  • PERCENTRANK.INC(array, x, [significance]) returns the rank of x as a fraction from 0 to 1, interpolating between neighbours. x outside the data is #N/A, and significance is truncated to an integer and must be at least 1 (otherwise #NUM!).
  • MODE.MULT(number1, ...) returns a column with every most frequent value, in order of first occurrence, and #N/A when no value repeats.
  • FREQUENCY(data_array, bins_array) returns a column with the count of values up to each bin and one more row for the values above the last bin. Text and blank cells are ignored.
  • PROB(x_range, prob_range, lower_limit, [upper_limit]) returns the probability that a value lies between the limits. The probabilities must be positive and sum to 1.
  • Implemented in PercentilePlugin and StatisticalAggregationPlugin, with metadata, translations, the license capability table entries and a CHANGELOG entry.

Behaviour check against Excel

122 formulas were evaluated in Excel Online (MS Graph live session) and in HyperFormula: 118 identical, 0 different, 4 not evaluable (calls with a wrong number of arguments, which Excel rejects when the formula is entered). They cover typed numbers (percentage, date and currency cells), booleans, text and numeric text, blank cells, errors, ranges and scalars, ties, bin ordering, limit ordering and the significance argument. Array results are read through INDEX, ROWS, COLUMNS and SUM, because they spill.

Translations

Names come from the Excel function translation table named in DEV_DOCS.md (Excel 2013), for 15 languages (for example de QUANTILSRANG.INKL, MODUS.VIELF, HÄUFIGKEIT, WAHRSCHBEREICH). The individual function pages were not checked one by one. Where a name would duplicate another function in the same language (nl FREQUENCY), and for enGB, enUS and idID, the English name is kept.

Tests

Paired tests branch: feat/hf-stats2-percentrank-inc-modemult-frequency-prob in the tests repository (159 tests). Full local run on this head: 524 suites, 6901 passed, 3 skipped.

🤖 Generated with Claude Code

marcin-kordas-hoc and others added 3 commits October 15, 2026 07:10
…ions

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
hyperformula-docs d102bd3 Commit Preview URL

Branch Preview URL
Oct 15 2026, 07:29 AM

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.96970% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.30%. Comparing base (05c1a29) to head (d102bd3).

Files with missing lines Patch % Lines
...interpreter/plugin/StatisticalAggregationPlugin.ts 95.83% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1818      +/-   ##
===========================================
+ Coverage    97.28%   97.30%   +0.02%     
===========================================
  Files          207      207              
  Lines        16218    16318     +100     
  Branches      3588     3609      +21     
===========================================
+ Hits         15777    15879     +102     
+ Misses         433      431       -2     
  Partials         8        8              
Files with missing lines Coverage Δ
src/error-message.ts 100.00% <100.00%> (ø)
src/i18n/languages/csCZ.ts 100.00% <ø> (ø)
src/i18n/languages/daDK.ts 100.00% <ø> (ø)
src/i18n/languages/deDE.ts 100.00% <ø> (ø)
src/i18n/languages/enGB.ts 100.00% <ø> (ø)
src/i18n/languages/esES.ts 100.00% <ø> (ø)
src/i18n/languages/fiFI.ts 100.00% <ø> (ø)
src/i18n/languages/frFR.ts 100.00% <ø> (ø)
src/i18n/languages/huHU.ts 100.00% <ø> (ø)
src/i18n/languages/idID.ts 100.00% <ø> (ø)
... and 12 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Performance comparison of head (d102bd3) vs base (05c1a29)

                                     testName |    base |    head |  change
---------------------------------------------------------------------------
                                      Sheet A |  446.96 |  442.67 |  -0.96%
                                      Sheet B |  150.91 |   148.6 |  -1.53%
                                      Sheet T |   124.9 |  130.03 |  +4.11%
                                Column ranges |  465.13 |  458.47 |  -1.43%
                                Sorted lookup | 13827.3 | 13461.1 |  -2.65%
Sheet A:  change value, add/remove row/column |   15.38 |    16.4 |  +6.63%
 Sheet B: change value, add/remove row/column |  129.84 |  143.84 | +10.78%
                   Column ranges - add column |  153.67 |  158.27 |  +2.99%
                Column ranges - without batch |  484.82 |  502.42 |  +3.63%
                        Column ranges - batch |  123.57 |  121.78 |  -1.45%

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant