xl get unique values

Function DistinctVals(a, Optional col = 1)
    Dim i&, v: v = a
    With CreateObject("Scripting.Dictionary")
        For i = 1 To UBound(v): .Item(v(i, col)) = 1: Next
        DistinctVals = Application.Transpose(.Keys)
    End With
End Function

'-----------------------------------------------------------------------

'If you happen to have Office365, the above function can be shortened
'to make use of the Office365 worksheet function 'UNIQUE()' instead 
'of the dictionary:

Function DistinctVals(r As Range)
  DistinctVals = WorksheetFunction.Unique(r)
End Function

4.5
2

                                    Function DistinctVals(a, Optional col = 1)
    Dim i&, v: v = a
    With CreateObject("Scripting.Dictionary")
        For i = 1 To UBound(v): .Item(v(i, col)) = 1: Next
        DistinctVals = Application.Transpose(.Keys)
    End With
End Function

'-----------------------------------------------------------------------

'If you happen to have Office365, the above function can be shortened
'to make use of the Office365 worksheet function 'UNIQUE()' instead 
'of the dictionary:

Function DistinctVals(r As Range)
  DistinctVals = WorksheetFunction.Unique(r)
End Function

4.5 (2 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how to find unique values in excel column select unique excel column execl unique values filter unique unique excel list differnte values in cells formula exce EXCEL FILTER disjoinct columns excel function to get unique values in a column get unique values only excel all unique values in a column esxcel vba unique valies excel check every value in d unique how to get all unique values from a column in excel get unique values from column excel excel move unique values to other list find all unique values in a column excel excel get all unique values from column how to find the unique values in a coumn how to get unique values from column excel How to find unique data in a column excel excel get unique values in column excel how to sort out distinct values distinct data excel unique list of column elemnt unique in column excel how to find every different value in excel column excel filter out unique values distinct value in excel excel check unique string how to find unique values from a column in excel unique values in excel excel select unique values filter unique rows in excel uniqe rows in excel seeht excel table column unique values how to have an excel column automatically remove duplicates show unique text once in column excel column unique values excel how to distinct values in excel excel filter distinct unique in excel column find distinct elements in excel select distinct from excel column filtering unique values in excel excel unique values in column select unique values in excel set unique values in excel select distinct values only in excel how to get unique values in column with repeated values filter unique values in a row in excell filter unique strings in a row exceell find unique strings in excell table find unique strings in excell get unique values from excel column how to pick unique values in excel how to find unique values in excel finding unique values in a data file excel get different values excel how to find all unique values in an excel column excel unique values in a column excel unique column rows unique filter excel filter duplicates select distinct excel count unique excel excel if duplicate remove all unique values in excel formula how to check unique values in excel excel unique items in column excel unique countifs excel select distinvt how to delete all duplicates in excel excel sheet duplicate entries filter excel highlight non-unique cells how to read uniques values in a column from excel in python how to read uniques values in a column from excel excel how to find all unique values in a column excel find unique values excel get unique values column get unique values excel row get a distinct list in excel excel get distinct values from column get distinct records from excel FILTER WITH UNIQUE EXCEL 365 distinct data filter how to get distinct values from a column using model return only unqiue values return only unqiue valuesv return only unqiue valuesvalues unique value filter excel get unique elements in column distinct formula in excel how to find distinct values in excel find unique values, excl select unique field in excel excel distinct excel get matrix unique values in row how to get unique values in a column in excel excel distinct rows excel make column unique filter distinct values in excel filter by duplicate rows excel check column and row in excel unique values return unique values in excel find all unique values in a column hide same values excel how to filter unique values in excel unique values of a column in excel how to find unique rows in excel excel diferent elements excel distinct values excel filter only unique values get unique values in excel excel filter by distinct excel extract unique columns distinct fields in excel how to find different values excel unique values show uniq values how can I retrieve non repetative value in a excel how to select unique rows in excel excel how to filter unique values excel filter unique excel get all unique values from a column find the uniques in excel excel filter unique values unique values in column unique values in column excel unique values in row excel excel get all unique values in column get unique values how to get unique values in excel distinct in excel extract only the unique values from a column in excel how to know unique filter in excel how to get only unique values in excel find unique values in excel uniq values excel get unique values from column filter unique in excel excel list distinct values in column excel how to count unique values distinct excel filter unique values in excel excel distinct on column excel user defined function get unique values excel udf get unique values excel get unique values xl get unique values xlvba get unique values xl vba get unique values excel vba distinct values vba distinct values vba distinct values from range excel vba distinct values from range find unique values in excel vba excel vba unique values vba unique values vba get unique values from column vba get distinct values from column vba excel paste same value multiple times vba get distinct values from range excel vba get distinct values from range excel vba get unique values from range excel vba get distinct values vba get unique values excel vba get unique values
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source