diff --git a/Applications/Spreadsheet/Spreadsheet.cpp b/Applications/Spreadsheet/Spreadsheet.cpp index 3ff03b0916..cac5424d1f 100644 --- a/Applications/Spreadsheet/Spreadsheet.cpp +++ b/Applications/Spreadsheet/Spreadsheet.cpp @@ -248,6 +248,9 @@ Optional Sheet::column_arithmetic(const StringView& column_name, int off if (!maybe_index.has_value()) return {}; + if (offset < 0 && maybe_index.value() < (size_t)(0 - offset)) + return m_columns.first(); + auto index = maybe_index.value() + offset; if (m_columns.size() > index) return m_columns[index];