Bug 101578 - unwanted VLOOKUP behaviour
Summary: unwanted VLOOKUP behaviour
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-17 12:46 UTC by Martijn Schrama
Modified: 2016-08-20 14:05 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
File with the unwanted behaviour (32.22 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-08-20 07:31 UTC, Martijn Schrama
Details
faulty VLOOKUP behaviour aswell (15.42 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-08-20 07:32 UTC, Martijn Schrama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martijn Schrama 2016-08-17 12:46:53 UTC
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36
Build Identifier:  f99d75f39f1c57ebdd7ffc5f42867c12031db97a

I have an calc sheet originally created in OO-4 but it kept crashing, so I switched to LO
The problem is with some VLOOKUP functions, 
it produces a large number in stead of text, and if I change anything to the formula it produces the correct response and when I change it back also, but as soon as I reopen the document it give the big number again.
example: =VLOOKUP($A48;$'All Orders'.A$1:I$10000;4)
removing for instance a $ will produce the correct value 
Also when I do a pull down to fix all cells it goes back to the wrong output, but when I first do 2 and than a pull down it works
basically it makes Calc useless unless this is fixed.

Reproducible: Always

Steps to Reproduce:
1.open document
2. fix the output
3. save the document
4. open the document
Actual Results:  
1273328996


Expected Results:  
Belgium





Reset User Profile?Yes
Comment 1 m_a_riosv 2016-08-17 20:53:28 UTC
Hi Martin, thanks for reporting.

Without a sample file it's not easy to know what is happening.

You are not using the fourth parameter so I guess the $'All Orders'.A$1:I$10000 is sorted.

Please could you attach a minimal sample file where to reproduce the error, and report what is your LibreOffice version (Menu/Help/About LibreOffice - you can select and copy the text)
Comment 2 Martijn Schrama 2016-08-20 07:31:39 UTC
Created attachment 126916 [details]
File with the unwanted behaviour

To 'solve' the problem delete row 102 from tab Feb and do a recalculation by pulling the first line down.
Comment 3 Martijn Schrama 2016-08-20 07:32:55 UTC
Created attachment 126917 [details]
faulty VLOOKUP behaviour aswell

When trying to recreate this issue I noticed that there are more things wrong with the VLOOKUP function as you can see in this simple file
Comment 4 Martijn Schrama 2016-08-20 07:34:36 UTC
More than 100 rows seem to be causing issues for sure, also parsing text looks to be a problem.
Comment 5 m_a_riosv 2016-08-20 12:33:54 UTC
(In reply to Martijn Schrama from comment #2)
> Created attachment 126916 [details]
> File with the unwanted behaviour
> 
> To 'solve' the problem delete row 102 from tab Feb and do a recalculation by
> pulling the first line down.

Win10x64 Version 5.1.5.2
Opening the file I see the wrong values in Feb column D, but after a hard recalc [Ctrl+Shift+F9] everything looks fine, even after save and open.
Comment 6 m_a_riosv 2016-08-20 12:42:59 UTC
(In reply to Martijn Schrama from comment #3)
> Created attachment 126917 [details]
> faulty VLOOKUP behaviour aswell
> 
> When trying to recreate this issue I noticed that there are more things
> wrong with the VLOOKUP function as you can see in this simple file

The problem here it's you are not using the fourth parameter for VLOOKUP and the searched array it's not sorted in ascending order.
As text 'Name 101' is smaller than 'Name 3'

https://help.libreoffice.org/Calc/Spreadsheet_Functions#VLOOKUP

So works for me adding to VLOOKUP with zero as fourth parameters.
Comment 7 Martijn Schrama 2016-08-20 12:46:57 UTC
(In reply to m.a.riosv from comment #5)
> (In reply to Martijn Schrama from comment #2)
> > Created attachment 126916 [details]
> > File with the unwanted behaviour
> > 
> > To 'solve' the problem delete row 102 from tab Feb and do a recalculation by
> > pulling the first line down.
> 
> Win10x64 Version 5.1.5.2
> Opening the file I see the wrong values in Feb column D, but after a hard
> recalc [Ctrl+Shift+F9] everything looks fine, even after save and open.

For me this does not do anything
Win7x64 Version: 5.1.4.2
Comment 8 m_a_riosv 2016-08-20 13:25:44 UTC
Please try resetting the user profile, sometimes solves strange issues.
https://wiki.documentfoundation.org/UserProfile
Usually it's enough renaming/deleting the file "user/registrymodifications.xcu",  it affects all the options in Menu/Tools/Options, and the files "user/basic/dialog.xlc" and "scrip.xlc" are overwritten, additionally custom colors in "user/config/standard.soc" are lost.
Comment 9 Martijn Schrama 2016-08-20 13:56:04 UTC
(In reply to m.a.riosv from comment #8)
> Please try resetting the user profile, sometimes solves strange issues.
> https://wiki.documentfoundation.org/UserProfile
> Usually it's enough renaming/deleting the file
> "user/registrymodifications.xcu",  it affects all the options in
> Menu/Tools/Options, and the files "user/basic/dialog.xlc" and "scrip.xlc"
> are overwritten, additionally custom colors in "user/config/standard.soc"
> are lost.

Appararently updating to the latest version seems to have done the trick