Created attachment 187918 [details] This bug is apparent on Row 2 of this spreadsheet. The LOOKUP function is not doing what it's supposed to, despite being used exactly as described in the Help section. The search vector & result vector are both one column. But I cannot figure out exactly how it determines the output. For the first many columns of cells I use as the search criterion, the function outputs "#N/A". I confirmed that the spellings do indeed match. But when I use a search criterion value that matches the first cell in the search vector column, I get the correct value. But then using any cells to the right of this one as input gives me the same output; the value of the first cell in the result vector. I don't know what it's doing, but it's not what it's supposed to do. I included the file as an attachment. See cells on the second row where this function is being used. It's supposed to return the 3-letter country code of the cell above.
The function works fine, you need to read carefully the help, because the searched range must be sorted ascending. And column A is not sorted. file:///C:/Program%20Files/LibreOffice/help/en-US/text/scalc/01/04060109.html?DbPAR=CALC#bm_id3159273
(In reply to m.a.riosv from comment #1) > The function works fine, you need to read carefully the help, because the > searched range must be sorted ascending. And column A is not sorted. > file:///C:/Program%20Files/LibreOffice/help/en-US/text/scalc/01/04060109. > html?DbPAR=CALC#bm_id3159273 Oh no! It does indeed say that. That's unfortunate. This really needs to be changed. Libreoffice Calc should definitely have a function that does this.
(In reply to Liam M from comment #2) … > > Oh no! It does indeed say that. That's unfortunate. This really needs to be > changed. Libreoffice Calc should definitely have a function that does this. the Formula exists: =VLOOKUP(D$1;$A$3:$B$28;2;0)