Files
PhpSpreadsheet/tests
DIReports 5e91ce2ba2 Fix VLOOKUP #N/A with whole-column ranges when end column has no data
When resolving the end reference of a whole-column range (e.g. $A:$F),
getHighestDataRow($col) was called for the specific end column. If that
column contains no data it returns 1, producing an inverted range such as
A4:F1. This caused VLOOKUP and similar functions to return #N/A when the
formula used a whole-column reference across sheets where data only exists
in the left-hand columns.

Fix: call getHighestDataRow() without a column argument so the overall
highest data row across all columns is used for the end reference.

Reproducer:
  Sheet2!A:D has data in cols A–C only; $A:$F produced A4:F1 → #N/A.
  After fix: A1:F4 → VLOOKUP finds the value correctly.
2026-08-19 16:25:33 +02:00
..