To keep track of expenses, I use formulas like the one below in several spreadsheets:
=IF(software.$AU16="";"";SUMIF(INDIRECT(AT$1);software.$AU16;INDIRECT(F$1)))
It first checks if there is an entry on the current row (16 in this example) in the column that contains years (AU in this case) and sums all software expenses in that year. I prefer the indirect adressing to make editing simpler AND to restrict the counting to those rows that have actually been filled with data.
I enter the data near the end of each month. So up to today only the January 2021 data are available. They are in row 69, as the result of the function =SUMPRODUCT(MAX(((A10:A500<>"")*ROW(A10:A500)))), the column A containing dates.
This morning I noted that the last entry did not contain the value of January, but of December 2020. When I added a check column, I saw that the total amount was exactly short of the January 2021 amount. But how I looked, I did not see an error in the formula.
Now when you do NOT use indirect addressing, you will get an error when the two ranges of the SUMIF function have different number of elements. And when I looked at the cells containing the search and summation ranges, I noted there was a difference. AT$1 contained the text AT9:AT69 (61 entries) and F$1 the text F8:F69 (62 entries). Cell F69 contains the January 2021 value, but the actual summation only summed the 2021 values in the range F8:F68. AT69 is the only cell containing 2021, and thus the contents of F68, containing the December 2020 values, was reported as the year-to-date sum of 2021.
Both Excel 365 and Libre Office produced the incorrect result. But it is all my fault, of course, not checking the ranges. I expected Excel and Libre Office to check if two indirect ranges contained the same number of elements and they do not. Is this a bug or a shortcoming of Excel and Libre Office?
You know what the late British PM Disraeli would say when he would still be around today: "There are lies, damned lies, consultants and spreadsheets".