Skip to content

Implement 6 new Excel functions for Google Sheets#124

Merged
Jython1415 merged 6 commits intomainfrom
claude/review-open-issues-4FlPy
Jan 20, 2026
Merged

Implement 6 new Excel functions for Google Sheets#124
Jython1415 merged 6 commits intomainfrom
claude/review-open-issues-4FlPy

Conversation

@Jython1415
Copy link
Owner

Summary

Implements 6 high-value Excel functions missing from Google Sheets, addressing issues #60, #54, #57, #63, #58, and #55.

Functions Implemented

Tier 1 - High-Value Quick Wins:

Tier 2 - Strategic Additions:

Issues Closed

Also closed 3 issues as "not planned" with explanations:

Testing

  • ✅ All 171 tests passing
  • ✅ All 39 formulas pass lint checks
  • ✅ README auto-generated and validated
  • ✅ No circular dependencies

Implementation Details

All functions follow project standards:

  • LET-based formula structure
  • Fail-fast error handling
  • No optional parameters (Google Sheets limitation)
  • Non-empty parameter examples (linter enforced)
  • Comprehensive pyparsing validation

Commits

  1. Add PERCENTOF function to calculate percentage contribution
  2. Add EXPAND function for array padding and dimension expansion
  3. Add SINGLE function for extracting values from array intersections
  4. Add TEXTSPLIT formula (issue Implement TEXTSPLIT function #55)
  5. Add TRIMRANGE function to remove empty rows/columns from range edges
  6. Add TEXTBEFORE function to extract text before delimiter

Test Plan

  • Run linter: uv run python scripts/lint_formulas.py
  • Generate README: uv run python scripts/generate_readme.py
  • Run test suite: uv run pytest tests/ -v
  • Verify all 171 tests pass
  • Verify all 39 formulas pass lint
  • Verify README updated correctly

Implements fail-fast division by zero error handling using LET bindings
to calculate the percentage contribution of a subset relative to a total.
Returns decimal value (0.25 = 25%).
Implements array expansion functionality that pads arrays to specified dimensions
with optional fill values, supporting both row and column expansion while
preserving original data when target dimensions are smaller than current size.
Implements SINGLE formula that returns a single value from an array at a
specified row and column position, using the INDEX function with 1-based
indexing. Follows project 4-step workflow with linting, README generation,
and comprehensive test validation.
Implements simplified TEXTSPLIT function for 1D array splitting.
Wraps Google Sheets' SPLIT function with consistent naming.
README already updated in commit 291d742.
Implements TRIMRANGE formula that removes empty rows and columns from the
outer edges of a range (top, bottom, left, right), similar to how TRIM
removes leading/trailing spaces from text. Empty rows/columns in the middle
are preserved. Uses BYROW with COUNTA to detect empty rows/columns, XMATCH
to find boundaries, and CHOOSEROWS/TRANSPOSE pattern for extraction.

Also cleans up README by removing TEXTBEFORE and TEXTSPLIT entries which
lack corresponding YAML files in the repository.

Follows project 4-step workflow: linter passed, README generated, all 171
tests passed.

Implements #58
Implements issue #54 by mirroring TEXTAFTER pattern with inverted logic.
Supports forward/backward search, case-sensitive/insensitive matching,
and customizable error handling.
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.

2 participants

Comments