How to sort a selections of non-continuous columns

yellowcedar

New Member
Joined
Jan 26, 2024
Messages
6
Office Version
  1. 2021
Platform
  1. Windows
I am trying to formulate a Summary sheet that organizes select data from my larger more complex Master sheet.

I have successfully used the below formula to reference and import a range from my Master sheet, and then sort the specified data's row order by value within column 7 (in descending order):
Excel Formula:
=SORT(Master!A10:V2127,7,FALSE)

Now, I would like to do this exact same thing, however this time only include only certain columns from within Master!A10:V2127 and change the order of these columns in my Summary sheet.
The five columns that should be included are C, D, Q, V, G (and they should be arranged in that order)

This formula
Excel Formula:
=SORT(CHOOSE({1,2,4,5,3}, Master!C10:C2127, Master!D10:D2127, Master!G10:G2127, Master!Q10:Q2127, Master!V10:V2127), 7, FALSE)
worked but it only displays the first row (row 10), and I need the entire range of rows (from 10:2127).

Is there a way I can change the above formula to make this work, or should I try using another method. I have seen mentions of doing this with INDEX and or SEQUENCE functions alongside the SORT function however I cannot figure out how to apply these to my circumstance.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
This formula
Excel Formula:
=SORT(CHOOSE({1,2,4,5,3}, Master!C10:C2127, Master!D10:D2127, Master!G10:G2127, Master!Q10:Q2127, Master!V10:V2127), 7, FALSE)
worked but it only displays the first row (row 10), and I need the entire range of rows (from 10:2127).
by dragging down the formula into cells below (which I should not have to do) I noticed that this is not sorting as needed and it is adding tons of empty rows between rows of data. I am doing something completely wrong here
 
Upvote 0
I tried putting this:
Excel Formula:
=SORT(INDEX(Master!A10:X2127, SEQUENCE(ROWS(Master!10:2127)),{3,4,17,22,7}),5,FALSE)
into cell A1 of my Summary sheet and it displayed only the value of Master!C10. Again if I drag this formula into other cells on my summary sheet it gives me an exact copy of what I already have in Master!C10:X2127.
 
Upvote 0
I have successfully used the below formula to reference and import a range from my Master sheet, and then sort the specified data's row order by value within column 7 (in descending order):
Excel Formula:
=SORT(Master!A10:V2127,7,FALSE)
:huh: Are you sure? Just returns a #VALUE! error for me. Presumably because the 3rd argument in the SORT function should be -1 for descending order, not FALSE.

(I also get similar errors for the other formulas that you are reporting as working at least partially.)

Now, I would like to do this exact same thing, however this time only include only certain columns from within Master!A10:V2127 and change the order of these columns in my Summary sheet.
The five columns that should be included are C, D, Q, V, G (and they should be arranged in that order)
Try this formula instead. One thing you did not clarify is what column to sort by. I have assumed the col 7 as you originally were doing. Only now with the reduced columns and changed order that is now col 5

Excel Formula:
=LET(r,Master!A10:V2127,SORT(INDEX(r,SEQUENCE(ROWS(r)),{3,4,17,22,7}),5,-1))
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

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