<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - lookup function does not evaluates properly when used with MIN function"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=116428">116428</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lookup function does not evaluates properly when used with MIN function
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0 all versions
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>justo.sabadell@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
In an array with columns A to E and 9 rows, I use lookup to search for the
maximum and minimum vale in each of the columns B to E and to report the
corresponding text on column A.

When using maximum, it works ok. When using minimum, it results on #N/A except
for the first evaluated column (B).

Steps to Reproduce:
1.Build a (at least) nx3 matrix: e.g. 9x3, where the first column (A) is
composed of text cells and the second and third (B and C) of numbers
2.Use formula with lookup function, e.g. in cell B10 use
"=LOOKUP(MIN(B1:B9),B1:B9,A1:A9)"
3.Use similar formula for C10:"=LOOKUP(MIN(C1:C9),C1:C9,A1:A9)"

Actual Results:  
Then, the results in cells B10 and C10 are:
- B10 -> gets the text in the A-column cell corresponding to the row that has
the minimum value among B1:B9, as expected
- C10 -> just gets #N/A

Expected Results:
C10 should behave as B10, given the text in the A-column cell which corresponds
to the row where the minimum value from C1:C9 is.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
IT evaluates correctly for the first column only. If the matrix has 3 or more
columns and trhe funtion is used, then it fails for all columns evaluated but
the first.
Funny enough it doesn't fails with MAX. 
It also fails if referred to another cell that reports MIN(C1:C9): e.g
"=LOOKUP(C11,C1:C9,A1:A9)", while C11 is "=MIN(C1:C9)".



User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Firefox/45.0</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>