Formula - SortBy and Filter Function

sprigelz

Board Regular
Joined
Jan 7, 2016
Messages
98
Office Version
  1. 365
Platform
  1. Windows
Hello again!

Just updated the formula and once again I seem to have broken something. The formula works just fine when the second (O2 - Training Event) and third (O3 - Last Name) conditions are entered, but for some reason breaks on the first (O1 - Branch) condition. Help? :LOL:

Excel Formula:
=IF(O1<>"",SORTBY(FILTER(TrainingTrack[[First]:[Entered Date]],TrainingTrack[Department]=Reports!O1),TrainingTrack[Date Completed],-1,TrainingTrack[Last],1),IF(O2<>"",SORTBY(FILTER(TrainingTrack[[First]:[Entered Date]],TrainingTrack[Training Event]=Reports!O2),TrainingTrack[Date Completed],-1,TrainingTrack[Last],1),SORT(FILTER(TrainingTrack[[First]:[Entered Date]],TrainingTrack[Last]=Reports!O3),5,-1)))

1660153197081.png
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Use sort rather than sortby like
Excel Formula:
SORT(FILTER(TrainingTrack[[First]:[Entered Date]],TrainingTrack[Department]=Reports!O1),{5,3},{-1,1})
 
Upvote 0
Solution
So that fixed it, but I'm curious to know why the SortBy would not work with that?

I've also adjust the second condition to just be Sort under the same conditions. Thank you so much!
 
Upvote 0
With sortby the arrays must be the same size, which they wont be as you filtering out some of the rows & the trying to use the entire column.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,276
Members
449,075
Latest member
staticfluids

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