mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-14 20:16:34 +00:00
5e91ce2ba2
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.