Bug 146391 - hlookup: when the search criteria contains a number, the search result will be NV
Summary: hlookup: when the search criteria contains a number, the search result will b...
Status: CLOSED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.2.4.1 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-23 14:57 UTC by rupert.graspeuntner
Modified: 2022-11-25 16:02 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
the error can be reproduced on tables "bezeichnung" and "Budget" (102.71 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-12-24 12:02 UTC, rupert.graspeuntner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rupert.graspeuntner 2021-12-23 14:57:43 UTC
Description:
 hlookup: when the search criteria contains a number, the search result will be NV

Actual Results:
NV

Expected Results:
the content of the addressed zell


Reproducible: Always


User Profile Reset: No



Additional Info:
none
Comment 1 Xisco Faulí 2021-12-23 15:35:07 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
(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.)
Comment 2 rupert.graspeuntner 2021-12-24 12:02:51 UTC
Created attachment 177123 [details]
the error can be reproduced on tables "bezeichnung" and "Budget"

to vary the occurrence of the error, in Table "Bezeichnung" modify Cells A23, A24, A25
you can see the result in Table "Budget",Cells e.g. e23, e24, e25

If you add in Table "Bezeichnung", Cell A21 a space as the first character, Table "Budget",Cells e.g. e23, e24, e25 show correct results
Comment 3 QA Administrators 2021-12-25 03:44:20 UTC Comment hidden (obsolete)
Comment 4 Eike Rathke 2022-11-25 16:01:43 UTC
Note: I did not enable macros for the document so cell results may vary. Just analyzing the structure.

Budget.E22:E24 try HLOOKUP() in the range's $jan_EIN.$c$9:$jan_EIN.$zz$14 first row so $jan_EIN.$c$9:$zz$9 but there is only some sparse content in that row and the rest is empty, in particular already C9, thus that row's content is not sorted ascending, which it would have to be if HLOOKUP() 4th argument is not given or not 0, otherwise the result is arbitrary.

Similar for Budget.H22:H24.

See https://help.libreoffice.org/7.4/en-GB/text/scalc/01/04060109.html?DbPAR=CALC#bm_id3151001

That *can't* work. It may already work if you change the HLOOKUP() functions passing a 4th argument 0, like in Budget.E22
=HLOOKUP($B22;INDIRECT(D$1):INDIRECT(E$1);5;0)

Not a bug.