mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-13 01:14:54 -06:00
test(calc): Excel-verified blank results for VLOOKUP, HLOOKUP and LOOKUP (#374)
Excel 365 for Windows (2609, build 16.0.20430.20032) keeps a lookup of an empty cell blank inside ISBLANK and concatenation for VLOOKUP, HLOOKUP and LOOKUP. The cases were checked in Excel by scottcampbelldata in vangel76/gridcraft#1. Co-Authored-By: scottcampbelldata <251750033+scottcampbelldata@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
scottcampbelldata
Claude Opus 5.5
parent
d446fde718
commit
9977d850a4
@@ -1193,6 +1193,24 @@ fn lookup_of_an_empty_cell_stays_blank() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blank_lookup_values_match_excel_windows_observation() {
|
||||
// Excel 365 Windows 2609, build 16.0.20430.20032, black-box check 2026-10-13:
|
||||
// A1="k", B1 and A2 genuinely empty.
|
||||
// All three value lookups preserve blankness inside ISBLANK/concatenation.
|
||||
let mut t = T::new();
|
||||
t.set("A1", "k");
|
||||
for (at, f, want) in [
|
||||
("D1", "=ISBLANK(VLOOKUP(\"k\",A1:B1,2,FALSE))", Value::Bool(true)),
|
||||
("D2", "=ISBLANK(HLOOKUP(\"k\",A1:A2,2,FALSE))", Value::Bool(true)),
|
||||
("D3", "=ISBLANK(LOOKUP(\"k\",A1:A1,B1:B1))", Value::Bool(true)),
|
||||
("D4", "=\"x\"&HLOOKUP(\"k\",A1:A2,2,FALSE)&\"y\"", Value::from("xy")),
|
||||
] {
|
||||
t.set(at, f);
|
||||
assert_eq!(t.get(at), want, "{f}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cell_width_is_the_column_width_dialog_value_rounded() {
|
||||
// #735: Excel 365 values. Widths in px as `home.columnWidth {"chars"}` sets them
|
||||
|
||||
Reference in New Issue
Block a user