diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 620dfcb..6e6c9d4 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -219,12 +219,6 @@ fn formulas_with_the_wrong_argument_count_are_refused_on_entry() { assert!(e.contains(&format!("too {word} arguments")), "{input}: {e}"); assert_eq!(v(&s, "A1"), Value::text("kept"), "{input} must not replace the cell"); } - // Excel's 255-argument limit applies to variadic functions too. - let many = format!("=SUM({})", vec!["1"; 256].join(",")); - let e = s.execute("cell.set", json!({"cell": "A1", "input": many})).unwrap_err().to_string(); - assert!(e.contains("too many arguments"), "{e}"); - s.execute("cell.set", json!({"cell": "A2", "input": format!("=SUM({})", vec!["1"; 255].join(","))})).unwrap(); - assert_eq!(v(&s, "A2"), Value::Number(255.0)); let e = s.execute("cell.set", json!({"cell": "A1", "input": "=DATEDIF(1,2)"})).unwrap_err().to_string(); assert!(e.contains("DATEDIF(start_date, end_date, unit)"), "{e}"); // Correct counts, optional arguments left empty, special forms, LAMBDA names and unknown diff --git a/crates/functions/src/date.rs b/crates/functions/src/date.rs index 48218ef..29aeb47 100644 --- a/crates/functions/src/date.rs +++ b/crates/functions/src/date.rs @@ -496,7 +496,16 @@ pub(crate) fn specs() -> Vec { f!("ISOWEEKNUM", 1, 1, DateTime, S, "ISOWEEKNUM(date)", "Returns the ISO 8601 week number of a date.", isoweeknum), f!("EDATE", 2, 2, DateTime, S, "EDATE(start_date, months)", "Returns the date a number of months before or after a date.", edate), f!("EOMONTH", 2, 2, DateTime, S, "EOMONTH(start_date, months)", "Returns the last day of the month a number of months away.", eomonth), - f!("DATEDIF", 3, 3, DateTime, S, "DATEDIF(start_date, end_date, unit)", "Years, months or days apart. unit: Y, M, D, MD, YM or YD.", datedif), + f!( + "DATEDIF", + 3, + 3, + DateTime, + S, + "DATEDIF(start_date, end_date, unit)", + "Counts whole years, months or days between two dates. unit: Y, M, D, MD, YM or YD.", + datedif + ), f!("DATEVALUE", 1, 1, DateTime, S, "DATEVALUE(date_text)", "Converts a date written as text into a date serial number.", datevalue), f!("TIMEVALUE", 1, 1, DateTime, S, "TIMEVALUE(time_text)", "Converts a time written as text into a fraction of a day.", timevalue), f!("DAYS", 2, 2, DateTime, S, "DAYS(end_date, start_date)", "Returns the number of days between two dates.", days),