How to sort columns in a particular sequence?

Lacan

Active Member
Joined
Oct 5, 2016
Messages
283
Office Version
  1. 365
Platform
  1. Windows
Hello Guys, 👌🖐

Keeping formula would like to sort columns in a particular sequence:

1.Sales (descending order);
2.Rank (ascending);
3.Code (descending).

Thank you very much for the help.👍👍🍻

2025.xlsx
ABCDEFGHIJKLM
1
2
3PARIS
4BRICKNAMECODESALESRANKBRICKNAMECODESALESRANK
5300 Lx - PARIS (MÁgua - Norte)XPTOD0340001299 Lx - NEW YORK (MÁgua - Sul)ABCD0769993
6301 Lx - PARIS (Venteira)FGOD0702299 Lx - NEW YORK (MÁgua - Sul)ABC2D0515033
7301 Lx - PARIS (Venteira)FGO1D0716412299 Lx - NEW YORK (MÁgua - Sul)ABC3D0403
8301 Lx - PARIS (Venteira)FGO2D04119552300 Lx - PARIS (MÁgua - Norte)XPTOD0340001
9302 Lx - PARIS (Falagueira)FGO3D0504300 Lx - LONDON (MÁgua - Norte)XPTO1D0101
10300 Lx - LONDON (MÁgua - Norte)XPTO2D063711
11301 Lx - PARIS (Venteira)FGOD0702
12301 Lx - PARIS (Venteira)FGO1D0716412
13301 Lx - PARIS (Venteira)FGO2D04119552
14302 Lx - PARIS (Falagueira)FGO3D0504
15
16
20-07-2024 (2)
Cell Formulas
RangeFormula
B5:F9B5=FILTER(CHOOSE({1,2,3,4,5},Tabela2[BRICK],Tabela2[NAME],Tabela2[CODE],Tabela2[SALES],Tabela2[RANK]),(ISNUMBER(SEARCH(B3,Tabela2[BRICK]))*(Tabela2[SALES]>=0)))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
B3ListNEW YORK; LONDON;PARIS
 
Hello, you may use:

Excel Formula:
=SORT(FILTER(CHOOSE({1,2,3,4,5},Tabela2[BRICK],Tabela2[NAME],Tabela2[CODE],Tabela2[SALES],Tabela2[RANK]),(ISNUMBER(SEARCH(B3,Tabela2[BRICK]))*(Tabela2[SALES]>=0))),{4,5,3},{-1,1,-1})
 
Upvote 0
Solution
Hello, you may use:

Excel Formula:
=SORT(FILTER(CHOOSE({1,2,3,4,5},Tabela2[BRICK],Tabela2[NAME],Tabela2[CODE],Tabela2[SALES],Tabela2[RANK]),(ISNUMBER(SEARCH(B3,Tabela2[BRICK]))*(Tabela2[SALES]>=0))),{4,5,3},{-1,1,-1})
Dear @hagia_sofia
Hope you are OK!

For small data works fine however for bigger data which is my case doesn´t match properly.
Can you please give a hand?
Thank you very much.🥂👍👍
 
Upvote 0
Many thanks for the feedback. Could you please elaborate on what is the problem - it it a performace issue (it calculates slowly) or something else?
 
Upvote 0
Many thanks for the feedback. Could you please elaborate on what is the problem - it it a performace issue (it calculates slowly) or something else?
Dear @hagia_sofia

Sorry it works fine!!!
My main table in the Ranking Column data it was not converted in number format so the formula doesn´t matched the correct results.
However maybe you can let me know if it is possible to use the comparison operators ( > , < , >= , <= ) not directly in the formula or individually in a unique cell?
Thank you very much.👍👍🥂
 
Upvote 0

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