Skip to content

feat(go): add 14 formula functions (stats, random, modern logic, XLOOKUP) - #4

Merged
Mukbeast4 merged 1 commit into
mainfrom
feature/formula-functions
Apr 24, 2026
Merged

feat(go): add 14 formula functions (stats, random, modern logic, XLOOKUP)#4
Mukbeast4 merged 1 commit into
mainfrom
feature/formula-functions

Conversation

@Mukbeast4

Copy link
Copy Markdown
Owner

Summary

Adds 14 spreadsheet functions to the formula engine:

Category Functions
Statistics `MEDIAN`, `STDEV`, `STDEVP`, `VAR`, `VARP`, `RANK`, `LARGE`, `SMALL`, `PERCENTILE`
Random `RAND`, `RANDBETWEEN` (uses `math/rand/v2`)
Modern logic `IFS`, `SWITCH`, `XLOOKUP` (exact match + default)

Why

Brings the function count from ~33 to ~47, closing the gap with Excel/Calc for common analytical workloads.

Test plan

  • `go test ./...`
  • `go vet ./...`
  • `gofmt -s -l .` (empty)
  • 19 new tests: per-function coverage, edge cases (empty inputs, out-of-range k, no-match defaults, invalid bounds), registration check, integration via `Evaluate` and `EvaluateFormula`

… RANK, LARGE, SMALL, PERCENTILE, RAND, RANDBETWEEN, IFS, SWITCH, XLOOKUP)
@Mukbeast4
Mukbeast4 merged commit 0b687d0 into main Apr 24, 2026
2 checks passed
@Mukbeast4
Mukbeast4 deleted the feature/formula-functions branch April 24, 2026 10:05
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