adding count2

This commit is contained in:
wkh
2026-09-03 08:49:20 +02:00
parent 0b7602b874
commit 9015a991aa
2 changed files with 9 additions and 4 deletions
+5
View File
@@ -52,6 +52,10 @@ export const FUNCTIONS: Record<string, FunctionFn> = {
return nums(values).length;
},
COUNT2(values) {
return values.length;
},
// IF(cond; then; else?) -- evaluator.ts special-cases this name *before*
// ever reaching FUNCTIONS, giving it real short-circuit evaluation (only
// the taken branch is computed, so e.g. IF(B1=0; 0; A1/B1) never runs the
@@ -152,6 +156,7 @@ export const BUILTIN_SIGNATURES: ReadonlyArray<{ name: string; hint: string }> =
{ name: 'MIN', hint: 'MIN(Zahl1; Zahl2; …)' },
{ name: 'MAX', hint: 'MAX(Zahl1; Zahl2; …)' },
{ name: 'COUNT', hint: 'COUNT(Zahl1; Zahl2; …)' },
{ name: 'COUNT2', hint: 'COUNT(Text1; Zahl2; …)' },
{ name: 'IF', hint: 'IF(Bedingung; Dann; Sonst?)' },
{ name: 'DATE', hint: 'DATE(Jahr; Monat; Tag)' },
{ name: 'TIME', hint: 'TIME(Std; Min; Sek)' },