Bug 145560 - VLOOKUP does not work when calc file is imported from Lotus 1-2-3 release 4 for windows
Summary: VLOOKUP does not work when calc file is imported from Lotus 1-2-3 release 4 f...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.1.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-05 16:37 UTC by Stuart Sabatini
Modified: 2022-09-10 11:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
TaxTest (2.57 KB, application/octet-stream)
2021-11-10 18:23 UTC, Michael Warner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Sabatini 2021-11-05 16:37:34 UTC
VLOOHUP ( search criterion; ARRAY; index)
index in 1-2-3 column number 0,1,2,etc
Libre calc appears to want column number 1,2,3,etc
in other words the number returned in Libre Calc is off by one column because it starts counting as 1 while the Louts 1-2-3 file starts at 0.
Comment 1 Michael Warner 2021-11-05 17:56:23 UTC
If you have an example Lotus 1-2-3 file, please remove any proprietary info and attach the file here. That way we can use it for testing.
Comment 2 Michael Warner 2021-11-10 18:23:53 UTC
Created attachment 176181 [details]
TaxTest

Received attachment via email.
Comment 3 Michael Warner 2021-11-10 18:24:47 UTC
From email:

Attached is a Lotus 1-2-3 file that shows the problem.  This is not the file that I first found the problem, but a much simpler file that shows the problem.  The file that first showed the problem is too large with too much personal info.

In the attached file, Input a income amount in cell E4 and cell F4 should show the amount of taxes.  When you first import the spreadsheet into Libre calc cell C4 shows 20000 and cell F4 shows 2002 which is correct but when the spreadsheet is recalculated cell F4 shows Err:502.  Simply re enter 20000 or any number into cell E4 to recalculate the spreadsheet and see the error.

 I figured out what is causing the problem, but not a easy fix.  The problem is caused by the index number in the VLOOKUP function.  VLOOKUP is looking for a number in column A,B or C of the spreadsheet depending on the index number.

Lotus 1-2-3 wants the index numbers to start at 0.  In this case, Columns A,B or C would be 0,1 or 2.

Libre Calc wants the index numbers to start at 1.  In this case, Columns A,B or C should be 1,2 or 3.
I could change the index numbers after the file is imported, but this requires a lot of work as my spreadsheets are very large.  This would work if it was a one time import but I must maintain the file on an older computer because of the Lotus Macro language programing in the file.  I wish to import the file to another computer that will not run Lotus 1-2-3 but as you can see from the attached file the VLOOKUP function does not work.

Thank you for your assistance
Stuart Sabatini
Comment 4 Julien Nabet 2022-09-10 11:16:59 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.