Create list of unique values from a range in Excel
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
add a comment |
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
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
add a comment |
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
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
excel excel-formula excel-2010 array-formulas
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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
Brilliant. Thank you!
– Dominic G.
Nov 19 '18 at 19:29
add a comment |
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
.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
Brilliant. Thank you!
– Dominic G.
Nov 19 '18 at 19:29
add a comment |
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
Brilliant. Thank you!
– Dominic G.
Nov 19 '18 at 19:29
add a comment |
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
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
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
add a comment |
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
add a comment |
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
.
add a comment |
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
.
add a comment |
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
.
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
.
answered Nov 19 '18 at 18:07
toroc
1118
1118
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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