Skip to content

feat(evaluator): Add P1 financial/date/type-check functions #74

@arcaputo3

Description

@arcaputo3

Background

These 14 functions enable complete financial modeling: TVM functions for debt schedules, date functions for projections, and type checking for validation.

Functions to Implement

Date Functions

Function Signature Use Case
EOMONTH EOMONTH(start_date, months) End of month N months away
EDATE EDATE(start_date, months) Same day N months away
YEARFRAC YEARFRAC(start, end, [basis]) Fraction of year between dates

Time Value of Money (TVM)

Function Signature Use Case
PMT PMT(rate, nper, pv, [fv], [type]) Loan payment
PV PV(rate, nper, pmt, [fv], [type]) Present value
FV FV(rate, nper, pmt, [pv], [type]) Future value
RATE RATE(nper, pmt, pv, [fv], [type], [guess]) Interest rate
NPER NPER(rate, pmt, pv, [fv], [type]) Number of periods

Statistics

Function Signature Use Case
MEDIAN MEDIAN(number1, [number2], ...) Median value
STDEV STDEV(number1, [number2], ...) Standard deviation (sample)
COUNTA COUNTA(value1, [value2], ...) Count non-empty cells

Type Checking

Function Signature Use Case
ISBLANK ISBLANK(value) Check if empty
ISNUMBER ISNUMBER(value) Check if numeric
ISTEXT ISTEXT(value) Check if text

Implementation Notes

TVM Functions

Standard financial formulas. type parameter: 0 = end of period (default), 1 = beginning.

YEARFRAC Basis

  • 0 = US 30/360 (default)
  • 1 = Actual/actual
  • 2 = Actual/360
  • 3 = Actual/365
  • 4 = European 30/360

RATE

Requires Newton-Raphson iteration (similar to IRR/XIRR).

Acceptance Criteria

  • All 14 functions parse correctly
  • All 14 functions evaluate correctly
  • Tests for TVM functions against Excel
  • Tests for date functions with edge cases
  • Update FunctionParser.buildRegistry()

Priority

P1 - High value for financial modeling

Labels

enhancement, evaluator

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions