• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Sort text with criteria

Oxidised

Member
Hi,
I have a list of text and a column with criteria (1 = yes, 0 = no). I need to be able to sort this list aphabetically and exclude the "0" on criteria.

Looking at some Chandoo posts and others, I know the formula will be an array style with the following format:
=Index(Array,Match(Small(IF...),(IF...)))

but I just can't seem to get it right?!?!?! If someone could please point out where I am going wrong, I would be very grateful!

{=IFERROR(INDEX(Table1[Name],MATCH(SMALL(IF(Table1[Criteria]=1,IF(ISBLANK(Table1[Name]),"",COUNTIF($E$1:E7,"<"&Table1[Name]))),1),IF(Table1[Criteria]=1,IF(ISBLANK(Table1[Name]),"",COUNTIF(E7:E7,"<"&Table1[Name]))))),"x")}

Thanks, Oxi
 

Attachments

  • Sort text with criteria.xlsx
    10.3 KB · Views: 8
=INDEX($A$3:$A$10,MATCH(SMALL(COUNTIF($A$3:$A$10, "<"&$A$3:$A$10), ROW(1:1)), COUNTIF($A$3:$A$10, "<"&$A$3:$A$10), 0))

Array Formula
 

Attachments

  • Sort text with criteria.xlsx
    10.6 KB · Views: 8
ah thanks!
small amendment for the criteria =
=IFERROR(INDEX($A$3:$A$10,MATCH(SMALL(IF($B$3:$B$10=1,COUNTIF($A$3:$A$10,"<"&$A$3:$A$10)),ROW(1:1)),IF($B$3:$B$10=1,COUNTIF($A$3:$A$10,"<"&$A$3:$A$10)),0)),"x")
 
Now if i want to make it a UNIQUE sorted list with a criteria... I would need to add a parameter like IF(countif([area above], list)=0,...) but i can't get this to work now...
=IFERROR(INDEX($A$3:$A$11,MATCH(SMALL(IF(Table1[Criteria]=1,IF(COUNTIF($H$2:H2,Table1[Name])=0,COUNTIF($A$3:$A$11,"<"&$A$3:$A$11))),ROW(1:1)),IF(Table1[Criteria]=1,IF(COUNTIF($H$2:H2,Table1[Name])=0,COUNTIF($A$3:$A$11,"<"&$A$3:$A$11))),0)),"x")
 

Attachments

  • Sort text with criteria.xlsx
    11.6 KB · Views: 2
Back
Top