Apache OpenOffice (AOO) Bugzilla – Issue 107377
vlookup does not update index when inserting/deliting columns
Last modified: 2016-11-28 00:38:12 UTC
If you insert/delete a column between the first column and the colum referenced by the index (offset), the index-count is not updated. All other cell references are updated. Because its hard for me to explain I attac a simple example. Open it mark column "C" and write-click and do a "insert column". The value in line 20 calculated by the vlookup function should not change, but does because the index is not adjusted from "4" to "5". Same happens when inserting cells with "move to right". And (untested) the same will be valid for hlookup. MS-office-2000 has the same behavour (which makes it not better). Newer versions of MS-office I do not have at hand to test.
Created attachment 66451 [details] Example to explain what is done
Both Gnumeric 1.9.10 and Excel 2007 behave the same. But I can imagine, that OOo holds a list of ranges which are used in VLOOKUP or similar functions and give a warning if inserting or deleting affects such a range. valid feature request
This issue is still present in version 4.1.3, the latest version. I just downloaded it and tested it. It's a problem because if you weren't aware of the bug, or if there was nothing in your spreadsheet to cause you to notice that this bug had made your spreadsheet results invalid/ incorrect, your results would be wrong and you might make serious financial decisions based upon incorrect information. (Which I nearly did.)
A static number should NEVER change! A programmer should know what he is doing. In the example simply change the formula from =VLOOKUP(A20;A6:E8;4;FALSE()) to =VLOOKUP(A20;A6:E8;COLUMNS(A4:D4);FALSE()) to make the value non static.