Bug Hunting Session
Bug 83131 - Provide ROWMAX, ROWMIN functions
Summary: Provide ROWMAX, ROWMIN functions
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2014-08-27 08:45 UTC by Robert Pollak
Modified: 2017-07-24 20:46 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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)".