LibreOffice version: 6.4.7.2 (latest in Ubuntu 20.04)
I have a single sheet spreadsheet which logs dividends received from investments, with some calculations to show the change from the previous year. These calculations are done using INDEX and MATCH, and whilst they work I get the following performance problems:
- Opening the spreadsheet file takes over 60 seconds.
- Inserting a new row into the sheet takes over 30 seconds.
- Adding data to any of the columns covered by the INDEX or MATCH (or columns which rely on them) takes over 30 seconds.
The number of rows involved is less than 100, and only grows at a rate of 12-15 per year, so this isn’t a ‘big data’ issue. Other spreadsheets don’t have these performance issues, and I’m using a fairly powerful machine (8 cores, 32GB RAM, SSD drive).
The relevant columns are as follows (where {row} is replaced by the row number and any column without a formula is a manually-entered string or number):
A: Stock market ticker (short string in all caps)
B: Year
C: Quarter
H: Original dividend
K: Previous Year: B{row}-1
L: Previous original dividend: =IFERROR(INDEX(H:H,MATCH(1,(A{row}=A:A)*(K{row}=B:B)*(C{row}=C:C),0)), "")
. Effectively this says ‘get the value from column H from the row where the Ticker (A) is the same as this row (A), the Year (B) is the same as the Previous Year (K) and the Quarter (C) is the same as this Quarter (C)’. In other words, the previous year’s same quarter dividend for the same ticker.
M: Original dividend change: =IF(L{row} <> "", (H{row}-L{row}) / L{row}, "")
Is there a way to address this performance issue, perhaps by rewriting the INDEX and MATCH formula? There will only ever be one match for the previous year, same quarter, same ticker dividend if that makes a difference.