SORT/FILTER formula

uk747

Well-known Member
Joined
Jul 20, 2011
Messages
832
Office Version
  1. 365
Platform
  1. Windows
CatRed
8​
DogBlue
7​
PigRed
6​
ElephantGreen
5​
BearYellow
2​

Hi
Trying to Filter A2:C100 Where Column B = "Red" and SORT 3rd Column Ascending. If Red Doesn't appear I want to use the IfEmpty Argument

I've used =SORT(FILTER($A$2:$C$100,($B$2:$B$100 = "Red")),3,1) which works, however I need to edit in case there aren't any results
i.e. =SORT(FILTER($A$2:$C$100,($B$2:$B$100="Red"),"Nothing to See HERE!"))
But when I add the Sort part to this I get a #Value! Error if Red doesn't appear in Column B =SORT(FILTER($A$2:$C$100,($B$2:$B$100="Red"),"Nothing to See HERE!"),2,1)

Result should be

PigRed
6​
CatRed
8​
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
For partial match try
Excel Formula:
=SORT(FILTER($A$2:$C$100,ISNUMBER(SEARCH("red",$B$2:$B$100)),{"No data","",""}),3,1)
 
Upvote 0
For partial match try
Excel Formula:
=SORT(FILTER($A$2:$C$100,ISNUMBER(SEARCH("red",$B$2:$B$100)),{"No data","",""}),3,1)
Thanks again

Managed to get close but no cigar when I tried
=SORT(FILTER($A$2:$C$20,(ISNUMBER(SEARCH("red",$B$2:$B$20),{"No data","",""}),3,1))) - Too may arguments for this function
=SORT(FILTER($A$2:$C$20,ISNUMBER(SEARCH("red",$B$2:$B$20)),{"No data","",""}),3,1) - Yours worked fine :)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

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