Hello,
I created a formula based on many post's helping users to get the top X rows of a table depending on a value in a specific column af the row.
I have an Epics table containing an Epic element in each line. One of the columns correspond to the Cost Deviation, another one to the FixVersion. I want to get the Top 5 Epics Keys by Cost Deviation for a given FixVersion and display them in another 5 cells.
The array formula I've created is as follows :
In french:
{=SIERREUR(INDEX(JEpicsTable[[Key]:[Key]];EQUIV(PETITE.VALEUR(NB.SI.ENS(JEpicsTable[[Cost Deviation]:[Cost Deviation]];">"&JEpicsTable[[Cost Deviation]:[Cost Deviation]];JEpicsTable[[FixVersions]:[FixVersions]];"*"&C$4&"*");LIGNE(1:1));NB.SI.ENS(JEpicsTable[[Cost Deviation]:[Cost Deviation]];">"&JEpicsTable[[Cost Deviation]:[Cost Deviation]];JEpicsTable[[FixVersions]:[FixVersions]];"*"&C$4&"*");0));"")}
In french simplified:
{=SIERREUR(INDEX(JEpicsTable[Key];EQUIV(PETITE.VALEUR(NB.SI.ENS(JEpicsTable[Cost Deviation];">"&JEpicsTable[Cost Deviation];JEpicsTable[FixVersions];"*"&C$4&"*");LIGNE(1:1));NB.SI.ENS(JEpicsTable[Cost Deviation];">"&JEpicsTable[Cost Deviation];JEpicsTable[FixVersions];"*"&C$4&"*");0));"")}
In english simplified:
{=IFERROR(INDEX(JEpicsTable[Key],MATCH(SMALL(COUNTIFS(JEpicsTable[Cost Deviation],">"&JEpicsTable[Cost Deviation],JEpicsTable[FixVersions],"*"&C$4&"*"),ROW(1:1)),COUNTIFS(JEpicsTable[Cost Deviation],">"&JEpicsTable[Cost Deviation],JEpicsTable[FixVersions],"*"&C$4&"*"),0)),"")}
The value of the given FixVersion is in C$4.
I am supposed to obtain the Top 5 elements by incrementing the ROW(1:1) like this : ROW(1:1), ROW(2:2), ROW(3:3)... but actually I obtain some duplicated keys in my results like A, A, A, B, B, C, D, E, F, F, G...
All correct keys are there and in the correct order, but since there are some duplicated lines in the results, I can't obtain dynamically the Top 5 by just incrementing the row index from 1 to 5.
Is there any way to filter duplicates (Duplicated keys in the results not duplicated Cost Deviations in the considered data) ? or to prevent genereting them by adapting the formula ?
I'm new into array formulas and I'm not sure I completely understanding what Excel is internally doing whith the CountIfs. Evaluate formula didn't help me to get it.
Thanks in advance for your help,
Xavier
Update 2021/08/30: Excel example has been attached to the post. It shows how repeated results are shown in the list, as well as some bigger values than others that are ignored. Thanks in advance for your help.
Bookmarks