Commit Graph

70 Commits

Author SHA1 Message Date
Brandon Thomas 80d282e7a5 Merge pull request #752 from marcoarnulfo:fix/function-excel-diffs-738 2026-10-13 01:39:44 -04:00
Brandon Thomas 5144bd5b17 Merge pull request #742 from marcoarnulfo:fix/edate-eomonth-1900 2026-10-13 01:39:43 -04:00
Brandon Thomas cc0b7c18d1 Merge main into #600
# Conflicts:
#	crates/calc/src/eval.rs
2026-10-13 00:49:39 -04:00
Brandon Thomas c888e81d71 Merge main into #593
# Conflicts:
#	crates/functions/src/text.rs
2026-10-13 00:48:34 -04:00
Marco Arnulfo 638cbab9a5 Merge remote-tracking branch 'origin/main' into fix/edate-eomonth-1900
# Conflicts:
#	crates/functions/src/date.rs
2026-10-13 06:29:36 +02:00
Marco Arnulfo ca8fc73281 Merge remote-tracking branch 'origin/main' into fix/function-excel-diffs-738
# Conflicts:
#	crates/calc/src/eval.rs
2026-10-13 06:29:34 +02:00
Brandon Thomas 727bd37983 Merge main into #751
# Conflicts:
#	crates/calc/src/tests.rs
2026-10-13 00:08:04 -04:00
Brandon Thomas d8561a9ed7 Merge pull request #755 from marcoarnulfo:fix/xludf-prefix 2026-10-12 23:49:23 -04:00
Brandon Thomas 45973a6804 Merge pull request #745 from marcoarnulfo:fix/mode-typed-text-bool 2026-10-12 23:49:12 -04:00
Brandon Thomas 705543521e Merge pull request #744 from marcoarnulfo:fix/roman-forms-2-3 2026-10-12 23:49:10 -04:00
Brandon Thomas 1d875bdf45 Merge pull request #686 from neilcawse:fix/criteria-over-255 2026-10-12 23:48:47 -04:00
Brandon Thomas ca9b3fbbe8 Merge pull request #586 from MarekSpodBiedry:issue-578 2026-10-12 23:35:32 -04:00
Brandon Thomas 2df8dd6392 Merge pull request #618 from MarekSpodBiedry:issue-540 2026-10-12 23:29:58 -04:00
Brandon Thomas 4941bf8da0 ROUNDUP keeps #NUM! past the number range; only toward-zero rounding returns 0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 23:29:56 -04:00
Brandon Thomas f6252418d9 Merge pull request #622 from MarekSpodBiedry:issue-536 2026-10-12 23:21:45 -04:00
Brandon Thomas 8474233335 Merge pull request #621 from MarekSpodBiedry:issue-537 2026-10-12 23:21:44 -04:00
Brandon Thomas c8f249fc97 Merge pull request #620 from MarekSpodBiedry:issue-538 2026-10-12 23:21:42 -04:00
Brandon Thomas 9e3a83464f Merge pull request #619 from MarekSpodBiedry:issue-539 2026-10-12 23:21:41 -04:00
Brandon Thomas 09c719623b Merge pull request #618 from MarekSpodBiedry:issue-540 2026-10-12 23:21:40 -04:00
neilcawse e5b12dab06 Functions: COUNTIF family counts the 255 criterion limit in UTF-16 units, as in Excel 2026-10-12 16:09:52 -04:00
neilcawse 4c2bcd637c Functions: *IFS with two or more criteria pairs match the first 255 characters of a longer criterion, as in Excel 2026-10-12 14:34:18 -04:00
Marco Arnulfo 531dc5a5aa functions: MODE comments name Excel 365 as the reference, not POI's cached values (#736) 2026-10-12 20:21:19 +02:00
neilcawse caf3193261 Functions: *IFS with two or more criteria pairs accept criteria over 255 characters, as in Excel 2026-10-12 14:19:29 -04:00
neilcawse 5524e2520a Functions: COUNTIF family returns #VALUE! for criteria over 255 characters
Excel rejects a text criterion longer than 255 characters in COUNTIF(S),
SUMIF(S), AVERAGEIF(S), MAXIFS and MINIFS with #VALUE!; GridCraft matched
it anyway. Found by the calc oracle on an Excel-saved report where a
268-character concatenated criterion caches #VALUE!.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 14:19:29 -04:00
Marco Arnulfo 4d2e8e3455 Functions: database functions evaluate computed criteria (part of #737)
A formula under a criteria label that names no field is evaluated for each record: its relative references move from the first record to that record, and the database labels name the record's fields, as in Excel. The calc evaluator passes the criteria reference to the database functions through Ctx::computed_criterion.
2026-10-12 19:16:00 +02:00
Marco Arnulfo f63a437d5b Formulas: keep _xludf. so user-defined calls stay user-defined (fixes #726)
The parser stripped _xludf. like _xlfn., but the two mean opposite things:
_xludf. marks a name Excel must not treat as a built-in. Keeping it in the
call name makes the call an unknown function (#NAME?, as in Excel) and the
writer emits it unchanged, so _xludf.EOMONTH() no longer saves as an
EOMONTH() call Excel repairs away.
2026-10-12 19:07:32 +02:00
Marco Arnulfo 0a27d4a5d4 Functions: MIRR, COUNTIF, INDIRECT and USDOLLAR match Excel 365 (fixes #738) 2026-10-12 19:04:17 +02:00
Marco Arnulfo eb534b5caf Functions: DGET skips empty result fields and "" criteria match any text (part of #737) 2026-10-12 18:58:34 +02:00
Marco Arnulfo 0dc76090d7 functions: MODE skips typed text and logical arguments (fixes #736) 2026-10-12 18:38:01 +02:00
Marco Arnulfo 9e28655a8a ROMAN: forms 2 and 3 subtract IC, XM and VM like Excel (fixes #733) 2026-10-12 18:37:51 +02:00
Marco Arnulfo e88d3d7583 EDATE and EOMONTH: serial 0 is day 0 and February 1900 has 28 days (fixes #734)
Excel's EDATE and EOMONTH read serial 0 as 0 January 1900 and end
February 1900 on the 28th (serial 59), although the sheet itself keeps
the Lotus 29 February 1900 (serial 60). GridCraft clamped day 0 up to
day 1 and used the sheet's 29-day February, so EDATE(0,0) was 1,
EDATE(0,1) 32, EDATE(31,1) and EOMONTH(59,0) 60.

EDATE now keeps day 0 and both functions take the real calendar's month
lengths. Serial 60 still reads as 29 February, so EDATE(60,1) stays
29 March. DATE, DAY and the parser keep the leap day.

Tests: the Excel 365 table from the issue; the #124 cases that expected
60 at the end of February 1900 now expect 59.
2026-10-12 18:36:51 +02:00
MarekSpodBiedry 53df51310f Check the full PIVOTBY layout size before building column headers (#537) 2026-10-12 08:37:38 +02:00
MarekSpodBiedry 9bbb263661 HSTACK checks its padded output size before building it (#536) 2026-10-12 08:36:37 +02:00
MarekSpodBiedry eec3353e83 Read date text in the workbook date system in arithmetic and VALUE (#564) 2026-10-12 08:35:55 +02:00
MarekSpodBiedry 555635e13e Return zero from ROUNDDOWN and TRUNC at precisions beyond the number range (#540) 2026-10-12 08:35:47 +02:00
MarekSpodBiedry 098b9e70b4 Reject oversized TEXTSPLIT results before building the padded grid (#538) 2026-10-12 08:35:32 +02:00
MarekSpodBiedry ff14224ff9 Convert TODAY and NOW to the workbook date system in 1904 workbooks (#578) 2026-10-12 08:34:40 +02:00
MarekSpodBiedry f8983e25eb Fix SEARCH position when text contains a char with multi-char lowercase (#571) 2026-10-12 08:34:04 +02:00
MarekSpodBiedry 358334c755 Return #VALUE! from FIND and SEARCH when the start is past the text end (#541) 2026-10-12 08:29:56 +02:00
MarekSpodBiedry 2eb5ef5b0d Return #NUM! from PROB for zero probabilities (#539) 2026-10-12 08:29:48 +02:00
Brandon Thomas dcd469d12e Merge pull request #419 from neilcawse/fix/function-fixes
Functions: MODE/VALUE/SUMPRODUCT text args, ADDRESS [Book]Sheet, Excel-style lookup bisection, SUBTOTAL skips filtered rows

# Conflicts:
#	docs/file-format-parity.md
#	docs/function-parity.md
2026-10-11 18:05:41 -04:00
Shirish Veerabattini 478f01d236 functions: keep DATEDIF's original description, add the units
Restores "Counts whole years, months or days between two dates." and
appends the units, in the multi-line form rustfmt gives a long entry.

Drops the 256-argument test case: the parser already refuses more than
255 arguments, so it never reached the entry check. (993c108's message
says entry "also refuses" them; it already did.)

Claude-Session: https://claude.ai/code/session_01BGBBGBC2gRpQ7GDuwQ6WPt
2026-10-11 15:57:33 -05:00
neilcawse 53690bace0 Functions: oracle fixes - MODE/VALUE/SUMPRODUCT text args, ADDRESS [Book]Sheet, Excel-style lookup bisection, SUBTOTAL skips filtered rows (table filter criteria kept)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:39:31 -04:00
Shirish Veerabattini 993c108660 functions: share the argument-count rule between call and entry
FnSpec::accepts holds the arity check (including Excel's 255-argument
limit) that functions::call and the entry check both use, so entry also
refuses 256 arguments to a variadic function. The evaluator's own check
in calc is unchanged.

Claude-Session: https://claude.ai/code/session_01BGBBGBC2gRpQ7GDuwQ6WPt
2026-10-11 15:37:09 -05:00
Shirish Veerabattini 9b59966cc9 Merge upstream main into fix/formula-arg-count-363
Claude-Session: https://claude.ai/code/session_01BGBBGBC2gRpQ7GDuwQ6WPt
2026-10-11 15:20:56 -05:00
Shirish Veerabattini 56f784473d engine: refuse formulas with the wrong argument count on entry
A formula calling a built-in function with too few or too many
arguments (=DATEDIF(a,b), =SUM(), =DATE(2024,1)) was stored and showed
#VALUE! with no hint about what was wrong. Entry now refuses it with
the function's signature, e.g. "DATEDIF has too few arguments. Use
DATEDIF(start_date, end_date, unit)", and leaves the cell unchanged.

Only registered functions are checked: special forms the evaluator
handles itself (IF, LET, LAMBDA...), LAMBDA names and unknown functions
are skipped. Paste and Find & Replace keep turning input that fails
entry into text. DATEDIF's description now lists its units.

Fixes #363

Claude-Session: https://claude.ai/code/session_01BGBBGBC2gRpQ7GDuwQ6WPt
2026-10-11 13:29:14 -05:00
Brandon Thomas 5360a77505 Merge remote-tracking branch 'origin/main' into fix-325
# Conflicts:
#	ROADMAP.md
#	crates/engine/src/cmd/mod.rs
#	crates/ui-egui/src/dialogs.rs
#	docs/gaps.md
#	docs/parity-checklist.md
#	docs/ui-parity.md
2026-10-11 13:12:41 -04:00
Brandon Thomas 867c5fd1f1 Merge pull request #317 from vangel76/feat/forecast-ets
Functions: FORECAST.ETS, .CONFINT, .SEASONALITY and .STAT (#314)

# Conflicts:
#	README.md
#	ROADMAP.md
#	docs/function-parity.md
#	docs/gaps.md
2026-10-11 12:05:55 -04:00
Brandon Thomas c2c381d55d Merge pull request #292 from vangel76/feat/bahttext
Functions: BAHTTEXT (#291)

# Conflicts:
#	README.md
#	ROADMAP.md
#	docs/function-parity.md
#	docs/gaps.md
#	docs/target-app-parity.md
2026-10-11 11:44:48 -04:00
Brandon Thomas fa4d2e5741 Merge pull request #280 from vangel76/feat/percentof-euroconvert
Functions: PERCENTOF and EUROCONVERT (#279)

# Conflicts:
#	README.md
#	ROADMAP.md
#	crates/functions/src/financial.rs
#	docs/function-parity.md
#	docs/gaps.md
#	docs/target-app-parity.md
2026-10-11 11:44:46 -04:00