Large Function with Absolute Value and sort based on Original Value

nrodrigues23

New Member
Joined
Apr 9, 2019
Messages
14
I have a range of 18 variances that I am looking to organize. My goal is to take the top 10 variances (positive or negative) and once they are identified, sorted from greatest to least (sorting their original values). Trying to work through this formula and this is far as i have gotten.
=LARGE(ABS(IF(OPEX_Summary_Desc<>"",OPEX_Sum_Variance_vs_Bud)),{1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18})
This formula has allowed me to identify the largest variances but it sorts based on the Absolute value that the formula is finding.
Any suggestions would be greatly appreciated.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
A bit tricky, but how about:

Book1
BCDEF
1
2a1-12
3b411
45-10
5d-49
6e49
7f98
8g-2-6
9h-10-4
10i-64
11j8-4
12k24
13l-22
14m11-2
15n22
16o-4-2
17p-121
18q90
19r0 
Sheet1
Cell Formulas
RangeFormula
F2:F19F2{=IFERROR(INDEX(OPEX_Sum_Variance_vs_Bud,MOD(LARGE(IF(OPEX_Summary_Desc<>"",MMULT(--(ABS(OPEX_Sum_Variance_vs_Bud)>TRANSPOSE(ABS(OPEX_Sum_Variance_vs_Bud))),ROW(OPEX_Summary_Desc)^0)*100+ROW(OPEX_Sum_Variance_vs_Bud)-ROW(INDEX(OPEX_Sum_Variance_vs_Bud,1))+1),ROWS($F$2:$F2)),100)),"")}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
Seems to work to find the values but I need the values to sort from greatest to least. To reference your example above, I would like to take the top 10 variances from column F and sort them from greatest to smallest (ie,. 11,9,8,4,2,-2,-4,-6,-10,-12).
Thanks so much for the help. let me know if you think this is possible.
 
Upvote 0
That's actually much easier:

Book1
BCDEF
1
2a111
3b49
459
5d-48
6e44
7f94
8g-22
9h-102
10i-61
11j80
12k2-2
13l-2-2
14m11-4
15n2-4
16o-4-6
17p-12-10
18q9-12
19r0 
Sheet1
Cell Formulas
RangeFormula
F2:F19F2{=IFERROR(LARGE(IF(OPEX_Summary_Desc<>"",OPEX_Sum_Variance_vs_Bud),ROWS(F$2:F2)),"")}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
How would you go about limiting the range to the top 10 variances? Keep in mind, I cant take the top 5 negative variances and top 5 positive variances. I would need the largest 10 variances (absolute value). Sorted positive to negative (like your last post).
Thanks a lot
 
Upvote 0
Only put the formula in the top 10 cells. In this example, delete everything from F12 down.
 
Upvote 0
Only put the formula in the top 10 cells. In this example, delete everything from F12 down.
I am looking to the largest 10 variances (absolute value).Keep in mind, I cant take the top 5 negative variances and top 5 positive variances. They would then need to be sorted positive to negative (like your last post).
Thanks a lot
 
Upvote 0
OK, let's try this:

Book1
BCDEF
1
2a111
3b49
459
5d-48
6e44
7f94
8g-2-4
9h-10-4
10i-6-6
11j8-10
12k2-12
13l-2
14m11
15n2
16o-4
17p-12
18q9
19r0
Sheet1
Cell Formulas
RangeFormula
F2:F12F2{=IFERROR(LARGE(IF(OPEX_Summary_Desc<>"",IF(ABS(OPEX_Sum_Variance_vs_Bud)>=LARGE(IF(OPEX_Summary_Desc<>"",ABS(OPEX_Sum_Variance_vs_Bud)),10),OPEX_Sum_Variance_vs_Bud)),ROWS(F$2:F2)),"")}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.


Notice that this list actually has 11 entries in it, because there is a tie on the lowest absolute value (4).
 
Upvote 0

Forum statistics

Threads
1,215,324
Messages
6,124,249
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top