Search code examples
excelfilterunique

Unique list with two criteria, advanced filter


I want to create a unique list that extracts a six digit number that begins with seven. Currently I am using a formula like, =IF(AND(LEFT(A2,1)="7",LEN(A2)<>6),0,A2) but, there are over 500 numbers.

Is there a way to use the Advanced filter to accept both criteria for each cell and also create a unique list of integers? This is for a colleague who tries to stay away from VBA.

For example,

242950  (assume this is in cell A2 and every following number is down a row)  
240338      
240427      
240419     
240435      
713082      
713104            
7131472     
2386274      
238104    
7124932  
712655  
712701  (A15)

My desired result would create the list

713082   
713104    
712655   
712701 

Solution

  • Set up your criteria as such:

    • C1 is blank
    • C2 put the formula: =AND(--LEFT(A2,1)=7,LEN(A2)=6)

    Then set up your Advanced filter:

    • List Range: $A$1:$A$15
    • Criteria Range: $C$1:$C$2
    • Check Unique records only

    enter image description here

    Hit OK.

    enter image description here