Mar 01 2024 06:45 AM
Hello!
I have an Excel table like the one below and I want to keep only the rows with highest values in column C when column A and B have equal values and also to keep all the rows that have different values across all the columns.
For example, for the rows 2, 3, 4 *that wahe equal values in columns A and B), I want to keep only one entry, which has the maximum value in column C (that will be row number 4) and also keep row number 5 (which has different values across all the cells) and so on.
Is there a way to do this in Excel?
Thanks!
Mar 01 2024 06:54 AM
@G_M_C I believe the easiest way would be to use Power Query for that. See attached. You familiar with PQ?
Mar 01 2024 06:57 AM
I'd create a helper formula in column D with formula
=C2=MAXIFS($C$2:$C$1000,$A$2:$A$1000,A2,$B$2:$B$1000,B2)
in D2, filled down.
You can then filter for FALSE.
Delete the filtered rows, and finally remove the filter.
Mar 01 2024 11:09 AM
Mar 01 2024 11:11 AM
Mar 01 2024 01:50 PM
There are new functions that may be brought into play as part of the solution algorithm. One such is GROUPBY. If the first two columns are named 'IDs' and the 3rd is 'weightedRatio', the formula
= GROUPBY(IDs, weightedRatio, MAX, , 0)
will filter out all the duplicate IDs, returning the maximum weighted ratio for each distinct combination.