Create list of unique values from a range in Excel












0














I have data (names) spread out in a sheet in Excel. It is in columns A through M.
Some rows have data in every column (A-M), some rows have nothing.



I want to extract a list of every unique value (or even a list of every value, and then I can remove duplicates) in the range.



For the life of me, I cannot figure out how to do this and haven't found an example online that pulls unique values from a RANGE, and not a single column.



Any ideas? Let me know if you need a screenshot of the data for more context.










share|improve this question






















  • Are you open to a VBA solution?
    – cybernetic.nomad
    Nov 19 '18 at 17:43










  • If it isn't too hard to figure out, sure! I have a little bit of VBA experience.
    – Dominic G.
    Nov 19 '18 at 17:51










  • stackoverflow.com/questions/5890257/…
    – Tim Williams
    Nov 19 '18 at 18:01
















0














I have data (names) spread out in a sheet in Excel. It is in columns A through M.
Some rows have data in every column (A-M), some rows have nothing.



I want to extract a list of every unique value (or even a list of every value, and then I can remove duplicates) in the range.



For the life of me, I cannot figure out how to do this and haven't found an example online that pulls unique values from a RANGE, and not a single column.



Any ideas? Let me know if you need a screenshot of the data for more context.










share|improve this question






















  • Are you open to a VBA solution?
    – cybernetic.nomad
    Nov 19 '18 at 17:43










  • If it isn't too hard to figure out, sure! I have a little bit of VBA experience.
    – Dominic G.
    Nov 19 '18 at 17:51










  • stackoverflow.com/questions/5890257/…
    – Tim Williams
    Nov 19 '18 at 18:01














0












0








0







I have data (names) spread out in a sheet in Excel. It is in columns A through M.
Some rows have data in every column (A-M), some rows have nothing.



I want to extract a list of every unique value (or even a list of every value, and then I can remove duplicates) in the range.



For the life of me, I cannot figure out how to do this and haven't found an example online that pulls unique values from a RANGE, and not a single column.



Any ideas? Let me know if you need a screenshot of the data for more context.










share|improve this question













I have data (names) spread out in a sheet in Excel. It is in columns A through M.
Some rows have data in every column (A-M), some rows have nothing.



I want to extract a list of every unique value (or even a list of every value, and then I can remove duplicates) in the range.



For the life of me, I cannot figure out how to do this and haven't found an example online that pulls unique values from a RANGE, and not a single column.



Any ideas? Let me know if you need a screenshot of the data for more context.







excel excel-formula excel-2010 array-formulas






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 19 '18 at 17:41









Dominic G.

16318




16318












  • Are you open to a VBA solution?
    – cybernetic.nomad
    Nov 19 '18 at 17:43










  • If it isn't too hard to figure out, sure! I have a little bit of VBA experience.
    – Dominic G.
    Nov 19 '18 at 17:51










  • stackoverflow.com/questions/5890257/…
    – Tim Williams
    Nov 19 '18 at 18:01


















  • Are you open to a VBA solution?
    – cybernetic.nomad
    Nov 19 '18 at 17:43










  • If it isn't too hard to figure out, sure! I have a little bit of VBA experience.
    – Dominic G.
    Nov 19 '18 at 17:51










  • stackoverflow.com/questions/5890257/…
    – Tim Williams
    Nov 19 '18 at 18:01
















Are you open to a VBA solution?
– cybernetic.nomad
Nov 19 '18 at 17:43




Are you open to a VBA solution?
– cybernetic.nomad
Nov 19 '18 at 17:43












If it isn't too hard to figure out, sure! I have a little bit of VBA experience.
– Dominic G.
Nov 19 '18 at 17:51




If it isn't too hard to figure out, sure! I have a little bit of VBA experience.
– Dominic G.
Nov 19 '18 at 17:51












stackoverflow.com/questions/5890257/…
– Tim Williams
Nov 19 '18 at 18:01




stackoverflow.com/questions/5890257/…
– Tim Williams
Nov 19 '18 at 18:01












2 Answers
2






active

oldest

votes


















2














Give this macro a try:



Sub MAINevent()
Dim it As Range, r As Range, x0
With CreateObject("scripting.dictionary")
For Each it In Range("A:M").SpecialCells(2)
x0 = .Item(it.Value)
Next

Set r = Cells(1, "N").Resize(.Count, 1)
r.Value = Application.Transpose(.Keys)
End With
End Sub


enter image description here






share|improve this answer





















  • Brilliant. Thank you!
    – Dominic G.
    Nov 19 '18 at 19:29



















1














You can use Go to Special (Ctrl+G -> Special) to select blanks and remove them (Ctrl+- with cells selected). Then use the formula described here to stack all your columns in one, on top of each other. Then replace formulas with values and finally, use Remove Duplicates.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379999%2fcreate-list-of-unique-values-from-a-range-in-excel%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Give this macro a try:



    Sub MAINevent()
    Dim it As Range, r As Range, x0
    With CreateObject("scripting.dictionary")
    For Each it In Range("A:M").SpecialCells(2)
    x0 = .Item(it.Value)
    Next

    Set r = Cells(1, "N").Resize(.Count, 1)
    r.Value = Application.Transpose(.Keys)
    End With
    End Sub


    enter image description here






    share|improve this answer





















    • Brilliant. Thank you!
      – Dominic G.
      Nov 19 '18 at 19:29
















    2














    Give this macro a try:



    Sub MAINevent()
    Dim it As Range, r As Range, x0
    With CreateObject("scripting.dictionary")
    For Each it In Range("A:M").SpecialCells(2)
    x0 = .Item(it.Value)
    Next

    Set r = Cells(1, "N").Resize(.Count, 1)
    r.Value = Application.Transpose(.Keys)
    End With
    End Sub


    enter image description here






    share|improve this answer





















    • Brilliant. Thank you!
      – Dominic G.
      Nov 19 '18 at 19:29














    2












    2








    2






    Give this macro a try:



    Sub MAINevent()
    Dim it As Range, r As Range, x0
    With CreateObject("scripting.dictionary")
    For Each it In Range("A:M").SpecialCells(2)
    x0 = .Item(it.Value)
    Next

    Set r = Cells(1, "N").Resize(.Count, 1)
    r.Value = Application.Transpose(.Keys)
    End With
    End Sub


    enter image description here






    share|improve this answer












    Give this macro a try:



    Sub MAINevent()
    Dim it As Range, r As Range, x0
    With CreateObject("scripting.dictionary")
    For Each it In Range("A:M").SpecialCells(2)
    x0 = .Item(it.Value)
    Next

    Set r = Cells(1, "N").Resize(.Count, 1)
    r.Value = Application.Transpose(.Keys)
    End With
    End Sub


    enter image description here







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 19 '18 at 18:10









    Gary's Student

    72.3k93762




    72.3k93762












    • Brilliant. Thank you!
      – Dominic G.
      Nov 19 '18 at 19:29


















    • Brilliant. Thank you!
      – Dominic G.
      Nov 19 '18 at 19:29
















    Brilliant. Thank you!
    – Dominic G.
    Nov 19 '18 at 19:29




    Brilliant. Thank you!
    – Dominic G.
    Nov 19 '18 at 19:29













    1














    You can use Go to Special (Ctrl+G -> Special) to select blanks and remove them (Ctrl+- with cells selected). Then use the formula described here to stack all your columns in one, on top of each other. Then replace formulas with values and finally, use Remove Duplicates.






    share|improve this answer


























      1














      You can use Go to Special (Ctrl+G -> Special) to select blanks and remove them (Ctrl+- with cells selected). Then use the formula described here to stack all your columns in one, on top of each other. Then replace formulas with values and finally, use Remove Duplicates.






      share|improve this answer
























        1












        1








        1






        You can use Go to Special (Ctrl+G -> Special) to select blanks and remove them (Ctrl+- with cells selected). Then use the formula described here to stack all your columns in one, on top of each other. Then replace formulas with values and finally, use Remove Duplicates.






        share|improve this answer












        You can use Go to Special (Ctrl+G -> Special) to select blanks and remove them (Ctrl+- with cells selected). Then use the formula described here to stack all your columns in one, on top of each other. Then replace formulas with values and finally, use Remove Duplicates.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 '18 at 18:07









        toroc

        1118




        1118






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379999%2fcreate-list-of-unique-values-from-a-range-in-excel%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

            How to fix TextFormField cause rebuild widget in Flutter