diff --git a/crates/functions/src/criteria.rs b/crates/functions/src/criteria.rs index db010fc..2c87a9a 100644 --- a/crates/functions/src/criteria.rs +++ b/crates/functions/src/criteria.rs @@ -51,8 +51,9 @@ impl Criterion { } } - /// Parses the criteria argument of COUNTIF(S), SUMIF(S), AVERAGEIF(S), MAXIFS and MINIFS: - /// like `parse`, but text longer than 255 characters is `#VALUE!`, as in Excel. + /// Parses the criteria argument of COUNTIF, SUMIF, AVERAGEIF and the single-pair *IFS + /// functions: like `parse`, but text longer than 255 characters is `#VALUE!`, as in Excel. + /// The *IFS functions with two or more criteria pairs use `parse`: Excel doesn't limit them. pub(crate) fn parse_arg(v: &Value) -> Result { match v { Value::Array(a) => Criterion::parse_arg(a.data.first().unwrap_or(&Value::Empty)), diff --git a/crates/functions/src/math.rs b/crates/functions/src/math.rs index 1233a40..75cea93 100644 --- a/crates/functions/src/math.rs +++ b/crates/functions/src/math.rs @@ -950,6 +950,10 @@ fn criteria_mask(a: &[Arg], first_pair: usize, rows: usize, cols: usize) -> R R0")]), 1.0); + close(ev("COUNTIFS", vec![rf(qty.clone()), t(">0"), rf(cells.clone()), t(&long)]), 1.0); + close(ev("SUMIFS", vec![rf(qty.clone()), rf(cells.clone()), t(&long), rf(qty), t(">0")]), 2.0); } }