Bug 122418 - Issue with Vlookup function
Summary: Issue with Vlookup function
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.1.3.2 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-02 11:03 UTC by hijaas313
Modified: 2019-01-10 18:06 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
vlookup Test (9.51 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2019-01-10 18:01 UTC, Oliver Brinzing
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hijaas313 2019-01-02 11:03:08 UTC
Description:
I have entered few names along with specific data and tried to call back in another part in the same sheet using vlookup but it worked with certain records but haven't given any results for some. I couldn't find out the reason or pattern for the issue

Steps to Reproduce:
1. created a data array
2. using vlookup I have tried to retrieve respective data into another cell
3. Not worked in the first attempt but after I have pressed F9 it worked for some records.
4. I tried the same procedure for other records it shown nothing.

Actual Results:
Sometimes, for some records shown the correct results and not for other's.

Expected Results:
When I enter the name of a person, which is defined in data array table it should retrieve the batch no (some number), item (Product), Price.


Reproducible: Couldn't Reproduce


User Profile Reset: No



Additional Info:
Comment 1 Oliver Brinzing 2019-01-02 12:20:08 UTC
Thank you for reporting the bug. 
Please attach a sample document, as this makes it easier for us to verify the bug. 
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
Comment 2 Oliver Brinzing 2019-01-10 18:01:17 UTC
Created attachment 148225 [details]
vlookup Test

added test file
Comment 3 Oliver Brinzing 2019-01-10 18:06:17 UTC
(In reply to hijaas313 from comment #0)
> I have entered few names along with specific data and tried to call back in
> another part in the same sheet using vlookup but it worked with certain
> records but haven't given any results for some. I couldn't find out the
> reason or pattern for the issue

vlookup formula has a 4th parameter you have to use, if the first 
columns is not sorted:

https://help.libreoffice.org/6.1/en-US/text/scalc/01/04060109.html?System=WIN&DbPAR=CALC#bm_id3152809

Enter the Boolean value FALSE() or zero if the first column is not sorted in ascending order, e.g.

=VLOOKUP($G$2;$A$3:$D$12;2;0)