Sort Formula Needed for non-adjacent Columns

BrettOlbrys1

Board Regular
Joined
May 1, 2018
Messages
128
Office Version
  1. 365
Platform
  1. Windows
Hello. I have the following formula: =SORT(FILTER(A2:G100,C2:C100>100),3,-1)

- I have a data file that I export from Sales system that contains 7 columns of data

- Assume the COMPANY is in column A, QTY column is column C, and the QUARTER is column F

- I want all of the returned columns of data to be sorted first by QUARTER (all quarters grouped together) and second by QTY (from greatest to least).

- The above SORT function returns every column in the data set where the QTY is greater than 100, but I only want specific columns, not every column. If I had 7 columns of data, and I only wanted columns A, C, and F as an example, how do I tell it what columns to return instead of every column?

*** The result should look something like this:

Company QuarterQty
Company Name1250
Company Name1120
Company Name2375
Company Name2300
Company Name3125
Company Name3110
Company Name4550
Company Name4230
 
No, the double comma is correct. There was an extra closing bracket that I missed, although having done a quick test on the formula before re-posting it, it doesn't work as well as I expected.
The double comma method normally returns all rows in the array, which means that it should work without the sequence function. For some reason the dynamic array functions don't like this so the sequence function is still needed. The slight change below to your original formula should do what you need although I have only done a quick test to make sure that it doesn't error, not to verify the results it returns.
Excel Formula:
=SORT(FILTER(INDEX('DATA - PBI ALL DATA'!E:Z,SEQUENCE(ROWS('DATA - PBI ALL DATA'!E:Z)),{1,21,15,18,2,4}),'DATA - PBI ALL DATA'!$H:$H>=100),{4,6},{1,-1})
This works great. If possible, I want to break the list up by quarters, so I believe I will need to have 4 columns and probably a formula for each column. So I will be adding a 2nd variable to show only the results I want, which would be:

Variables - H:H>100 and V:V=1

So how do I modify the formula for this example?
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Try
Excel Formula:
=SORT(FILTER(INDEX('DATA - PBI ALL DATA'!E:Z,SEQUENCE(ROWS('DATA - PBI ALL DATA'!E:Z)),{1,21,15,18,2,4}),('DATA - PBI ALL DATA'!$H:$H>=100)*('DATA - PBI ALL DATA'!$V:$V=1)),{4,6},{1,-1})
 
Upvote 0
Solution

Forum statistics

Threads
1,215,647
Messages
6,126,006
Members
449,280
Latest member
Miahr

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