What
COUNT matches only Value::Number and falls to _ => {} for everything else, so it does not count a date.
=COUNT(DATE(2020,1,1)) truecalc: 0 Sheets: 1
Google Sheets counts dates — they are numbers with a display format.
Why it is worth filing now
It has become newly reachable. Once MAX/MIN/MAXA/MINA return a date-typed result for a date range (the captured Sheets behaviour), every extreme taken over a date column flows into this:
=COUNT(MAX({DATE(2020,1,1),5})) before: 1 after: 0
Verified on both builds. Same flip for MIN, MAXA, MINA.
Failure scenario: =COUNT(MAX(Orders!A:A)) over a date column returned 1 and now returns 0. A "how many results did I get" guard silently becomes zero — a believable wrong answer rather than a visible error.
The root cause is pre-existing and independent of that change; the change only exposes it.
The catch-all is still live
A reviewer added a probe variant to Value and ran cargo check on both sides. On the branch that types the extremes, max/min/maxa/mina are all flagged non-exhaustive — those four were deliberately refactored away from catch-alls so a new variant is a compile error. statistical/count/mod.rs is flagged on neither side: its _ => {} silently absorbs any variant added in future.
That is the same shape as a defect already fixed once in this area, where a catch-all swept Value::Date into a "has content" flag and turned a visible #REF! into a believable 0.
Scope
- Probe first.
=COUNT(DATE(2020,1,1)), =COUNT(<a date range>), dates mixed with numbers, COUNTA for comparison, and the same for any sibling reducer sharing the shape. Do not fix from reasoning — "Sheets counts dates" is widely believed and this repo forbids self-confirmed values. The conformance-fixtures pipeline now has working range-based probes for the statistical functions.
- Replace the catch-all with an explicit match so a future
Value variant is a compile error rather than a silent zero.
- Prove nothing else moved with a differential against
main, reporting the case count. COUNT is used everywhere.
Acceptance criteria
Related
What
COUNTmatches onlyValue::Numberand falls to_ => {}for everything else, so it does not count a date.Google Sheets counts dates — they are numbers with a display format.
Why it is worth filing now
It has become newly reachable. Once
MAX/MIN/MAXA/MINAreturn a date-typed result for a date range (the captured Sheets behaviour), every extreme taken over a date column flows into this:Verified on both builds. Same flip for
MIN,MAXA,MINA.Failure scenario:
=COUNT(MAX(Orders!A:A))over a date column returned1and now returns0. A "how many results did I get" guard silently becomes zero — a believable wrong answer rather than a visible error.The root cause is pre-existing and independent of that change; the change only exposes it.
The catch-all is still live
A reviewer added a probe variant to
Valueand rancargo checkon both sides. On the branch that types the extremes,max/min/maxa/minaare all flagged non-exhaustive — those four were deliberately refactored away from catch-alls so a new variant is a compile error.statistical/count/mod.rsis flagged on neither side: its_ => {}silently absorbs any variant added in future.That is the same shape as a defect already fixed once in this area, where a catch-all swept
Value::Dateinto a "has content" flag and turned a visible#REF!into a believable0.Scope
=COUNT(DATE(2020,1,1)),=COUNT(<a date range>), dates mixed with numbers,COUNTAfor comparison, and the same for any sibling reducer sharing the shape. Do not fix from reasoning — "Sheets counts dates" is widely believed and this repo forbids self-confirmed values. The conformance-fixtures pipeline now has working range-based probes for the statistical functions.Valuevariant is a compile error rather than a silent zero.main, reporting the case count.COUNTis used everywhere.Acceptance criteria
COUNTover dates, and for any sibling with the same gapCOUNTagrees with the captureValuevariant fails to compile rather than being silently uncountedmainshows no unrelated input changed, with the case count reportedRelated