Bug 83131

Summary: Provide ROWMAX, ROWMIN functions
Product: LibreOffice Reporter: Robert Pollak <robert.pollak>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: enhancement CC: suokunlong
Priority: medium    
Version: 4.3.0.4 release   
Hardware: Other   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 108827    

Description Robert Pollak 2014-08-27 08:45:37 UTC
Similar to the mathematical "arg max" (see https://en.wikipedia.org/wiki/Arg_max), ROWMAX(<region>) should return the number of the (first) row, where MAX(<region>) is reached.

E.g. for

   A: B:
1: 6  4
2: 2  8

, ARGMAX(A1:B2) should be 2.
Comment 1 Robert Pollak 2014-08-27 08:49:28 UTC
Use case:

Given a table with columns "year" and "income", calculate the year with highest income.
Comment 2 Kevin Suo 2014-11-10 07:44:33 UTC
This is an enhancement request, looks resonable for me.
Set to NEW.
Comment 3 Robert Pollak 2014-11-10 08:39:00 UTC
Additionally, there should be COLMAX,COLMIN for the number of the maximal/minimal column.

I just see that my description is inconsistent: It should be ROWMAX, not ARGMAX.

Actually, maybe ARGMAX is even better than ROWMAX/COLMAX: It could return the cell reference of the maximal/minimal value. In my use case, the year with maximal income would then be "=OFFSET(ARGMAX(<income column>), 0, -1)".

Hmm - I just found out that the whole functionality is partially covered by HLOOKUP/VLOOKUP. In my use case, the "income" column would need to be left of the "year" column, then the year with maximal income is "=VLOOKUP(MAX(<income column>), <table region>, 2, FALSE)".