Let's say we have a dataframe in Sheet 1 of the workbook and the desired output in sheet 2 is to return the maximum value in Var3
for each unique value in Var1 and the corresponding value in Var2.
Dataframe:
Desired output:
The code below only gives the maximum value of all values as shown below:
=TAKE(SORT(HSTACK(INDEX(Sheet1!B2:C19,,MATCH(E1,Sheet1!C1,0)),CHOOSECOLS(Sheet1!A2:C19,1),CHOOSECOLS(Sheet1!A2:C19,2)),1,-1),5)
Try the following formula:
• Formula used in cell E3