extract or copy only one value that's unique across multiple columns

monere

Board Regular
Joined
Jul 12, 2014
Messages
149
Office Version
  1. 2016
Platform
  1. Windows
Hey, guys!

I have a 10-column sheet with both unique and non-unique values (which are actually text, not numeric values, if this matters) across different columns. For example... column 1 has 27 rows of text, column 2 has 33 rows of text, column 3 has 14 rows of text, column 4 has 62 rows of text, and so on.... so random number of values but also random values but which sometimes coincide with the values in other columns, and sometimes they don't.

Now, these values are 1-word, 2-words, or 3-words, in case that this matters in your helping me solve my issue.

So, what I'm trying to do is either extract all of the unique values across the entire sheet and insert them into a separate column, or copy those unique values to clipboard so I can paste them into a separate column myself. But the trick is that it only one instance of each value needs to be extracted / copied, but all of the values that appear at least once across all columns need to be extracted / copied, as well.

For example, let's say that a value appears in columns 2, 5, and 9. So, it appears 3 times in total across the entire sheet. Well, I would like excel to - like I said - either extract this value out of whichever column (I don't care where it extracts it from, I only need the value itself, I don't care if the configuration of the sheet gets screwed) and automatically paste it into a designated column (which I can manually create, or let the software do it, I don't care again), or just copy it to the clipboard so I can manually paste it into whichever column I choose.

And after this is done with the 1st value that excel reads starting with R1C1, it will then move onto the value that's in R2C1, then R3C1, and so on...

I forgot to mention that each column contains only 1 instance of whichever value is in that column, so there won't be any duplicate values within any 1 column itself, but there will be duplicate values across multiple columns, like I said.

So yeah, that's what I'm trying to do, I hope that you, smart folks, could understand what I'm trying to accomplish and can help me out, because I'm not good with such advanced methods of data manipulation despite of the fact that I do like excel and toy with it as much as I get the chance.

So, can someone give me a tip or 2 on how to do this? I could do it manually without a problem as there are not many values to sift through and extract individually, but the problem is that this is only 1 file,, and soon I'll have to do this exact same thing for more files and it's just not time-efficient doing this manually, especially with the other files containing even more data. I think that finding a way to automate this is the best way to go about it, but alas, I'm not tech-savvy so I always struggle figuring tech stuff on my own.

Anyway, please let me know how to accomplish this if it's not too much trouble. Thanks in advance :)
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I hope that you, smart folks, could understand what I'm trying to accomplish ..
Not easy from a long wordy description. What about a small set of dummy sample data and the expected results?

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Not easy from a long wordy description.
I don't like long descriptions either, but I can assure you that I only wrote what needed to be mentioned to explain the issue. I would never bore you, guys, with useless ramblings, don't worry :)

What about a small set of dummy sample data and the expected results?
unfortunately, I can't provide actual data as it's private, but I'll figure out something when I get home (in about 2-3 hours, possibly earlier but we will see...)

The expected results is what I just mentioned in my OP, ie: all values that are unique across the entire sheet need to be extracted (cut-pasted), or copied to clipboard and pasted into a separate column (whichever method works, I'm not fussy about it)

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in
got it! I'll take a look at it when I get home...

Cheers!
 
Upvote 0
That is why is said
Fair point, but somehow I missed it. I apologize

Here's the mini sheet thing, I hope that I did it right. If not, I'll gladly fix what needs to be fixed. Also, the dummy data that I've used is dog breeds, I hope that it's ok as dummy text as it's pretty close to what my real data is anyway

Based on your instructions, I've posted the table below to show how my real sheet would look like, but there are still a few things that need to be mentioned to get the full picture of what I'm trying to do:

1) the table below contains 5 columns of data (there are 6 columns actually, but column A shows what the end result - and the reason for which I've opened up this thread - needs to be, while columns B to F are the data that column A needs to extract the data from), but my real sheet would have more columns of data. So, if there's a formula that needs to include the number of columns in the final solution please let me know so that I can adjust that formula according to my case;

2) highlighted in yellow are 6 dog breeds that appear only once in the entire sheet. I've purposely added these 6 breeds in, because my real sheet would also include once-off values spread randomly throughout the entire sheet, and this is important because these once-off occurrences also need to be extracted / copied into column A, not just the values that repeat in multiple columns;

3) the censored word in R13C1 is C.0.C.K.E.R, sorry for the censoring, but that's probably been done by your software as my excel doesn't censor words;

4) while in the table below there are no such entries, in the real sheet there will be 2-word or 3-word entries that will contain special characters (most of the time hyphens, underscores or slashes, but there could also be "greater than" signs or brackets) and those special characters / symbols need to be carried into the final solution, so this is probably important to mention.

And that's it! I don't think such data is hard to manipulate by a tool like excel, but I and science are not good friends, so I have no idea how to do it myself :)

xl2bb.xlsx
ABCDEF
1Australian ShepherdAustralian ShepherdAustralian ShepherdAustralian ShepherdCardigan Welsh CorgiAmerican Water Spaniel
2Airedale TerrierBasset HoundAiredale TerrierAmerican Water SpanielChihuahuaBeagle
3American Water SpanielBlack Russian TerrierAmerican Water SpanielBeagleChinese CrestedBasset Hound
4BeagleCardigan Welsh CorgiBeagleBasset HoundDachshundChihuahua
5Basset HoundChihuahuaBasset HoundBlack Russian TerrierDoberman PinscherChinese Crested
6Black Russian TerrierChinese CrestedBlack Russian TerrierCardigan Welsh CorgiFrench BulldogDachshund
7Cardigan Welsh CorgiDachshundCardigan Welsh CorgiChinese CrestedFlat-Coated RetrieverDoberman Pinscher
8ChihuahuaKarelian Bear DogChihuahuaDachshundGolden RetrieverEnglish Setter
9Chinese CrestedLeonbergerChinese CrestedDoberman PinscherGreyhoundEurasier
10DachshundLucas TerrierDachshundEnglish ****er SpanielGerman Longhaired PointerFrench Bulldog
11Doberman PinscherMastiffDoberman PinscherEnglish SetterHavaneseFlat-Coated Retriever
12Danish-Swedish FarmdogMountain FeistDanish-Swedish FarmdogEurasierHamilton HoundHamilton Hound
13English ****er SpanielOld English SheepdogEnglish ****er SpanielFlat-Coated RetrieverIrish Water SpanielIrish Setter
14English SetterPoodleEnglish SetterGolden RetrieverJack Russell TerrierIcelandic Sheepdog
15EurasierPortuguese Podengo PequenoEurasierGreyhoundJagdterrierJack Russell Terrier
16French BulldogPicardy SpanielFrench BulldogHavaneseKeeshondJagdterrier
17Flat-Coated RetrieverRhodesian RidgebackFlat-Coated RetrieverHamilton HoundKarelian Bear DogKeeshond
18Golden RetrieverRottweilerGolden RetrieverIrish SetterLeonbergerKorean Jindo
19GreyhoundWhippetGreyhoundIcelandic SheepdogPoodleLeonberger
20German Longhaired PointerGerman Longhaired PointerJack Russell TerrierPortuguese Podengo PequenoMountain Feist
21HavaneseHavaneseJagdterrierPicardy SpanielOld English Sheepdog
22Hamilton HoundHamilton HoundKeeshondYorkshire TerrierPoodle
23Irish SetterIrish SetterKorean JindoPortuguese Podengo Pequeno
24Icelandic SheepdogIcelandic SheepdogKarelian Bear DogPicardy Spaniel
25Irish Water SpanielIrish Water SpanielLeonbergerSiberian Husky
26Jack Russell TerrierJack Russell TerrierMastiffSloughi
27JagdterrierJagdterrierMountain FeistToy Fox Terrier
28KeeshondKeeshondOld English Sheepdog
29Korean JindoKorean JindoPortuguese Podengo Pequeno
30Karelian Bear DogKarelian Bear DogPicardy Spaniel
31LeonbergerLeonbergerRhodesian Ridgeback
32Lucas TerrierLucas TerrierRottweiler
33MastiffMastiffVizsla
34Mountain FeistMountain Feist
35Old English SheepdogOld English Sheepdog
36PoodlePoodle
37Portuguese Podengo PequenoPortuguese Podengo Pequeno
38Picardy SpanielPicardy Spaniel
39Rhodesian RidgebackRhodesian Ridgeback
40RottweilerRottweiler
41Siberian Husky
42Sloughi
43Toy Fox Terrier
44Vizsla
45Whippet
46Yorkshire Terrier
Sheet1
 
Upvote 0
Sorry if I am missing something, but I can't see that the yellow values are anything different to the others.
So, doesn't this just boil down to simply "produce a list of the unique values that appear in the multi-column data"?
If so, and you are looking for a formula solution (rather than vba or power query), that will work with Excel 2016, what about this?

monere.xlsm
ABCDEF
1Unique ListAustralian ShepherdAustralian ShepherdAustralian ShepherdCardigan Welsh CorgiAmerican Water Spaniel
2Australian ShepherdBasset HoundAiredale TerrierAmerican Water SpanielChihuahuaBeagle
3Cardigan Welsh CorgiBlack Russian TerrierAmerican Water SpanielBeagleChinese CrestedBasset Hound
4American Water SpanielCardigan Welsh CorgiBeagleBasset HoundDachshundChihuahua
5Basset HoundChihuahuaBasset HoundBlack Russian TerrierDoberman PinscherChinese Crested
6Airedale TerrierChinese CrestedBlack Russian TerrierCardigan Welsh CorgiFrench BulldogDachshund
7ChihuahuaDachshundCardigan Welsh CorgiChinese CrestedFlat-Coated RetrieverDoberman Pinscher
8BeagleKarelian Bear DogChihuahuaDachshundGolden RetrieverEnglish Setter
9Black Russian TerrierLeonbergerChinese CrestedDoberman PinscherGreyhoundEurasier
10Chinese CrestedLucas TerrierDachshundEnglish ****er SpanielGerman Longhaired PointerFrench Bulldog
11DachshundMastiffDoberman PinscherEnglish SetterHavaneseFlat-Coated Retriever
12Doberman PinscherMountain FeistDanish-Swedish FarmdogEurasierHamilton HoundHamilton Hound
13French BulldogOld English SheepdogEnglish ****er SpanielFlat-Coated RetrieverIrish Water SpanielIrish Setter
14Flat-Coated RetrieverPoodleEnglish SetterGolden RetrieverJack Russell TerrierIcelandic Sheepdog
15Karelian Bear DogPortuguese Podengo PequenoEurasierGreyhoundJagdterrierJack Russell Terrier
16Golden RetrieverPicardy SpanielFrench BulldogHavaneseKeeshondJagdterrier
17English SetterRhodesian RidgebackFlat-Coated RetrieverHamilton HoundKarelian Bear DogKeeshond
18LeonbergerRottweilerGolden RetrieverIrish SetterLeonbergerKorean Jindo
19GreyhoundWhippetGreyhoundIcelandic SheepdogPoodleLeonberger
20EurasierGerman Longhaired PointerJack Russell TerrierPortuguese Podengo PequenoMountain Feist
21Lucas TerrierHavaneseJagdterrierPicardy SpanielOld English Sheepdog
22English ****er SpanielHamilton HoundKeeshondYorkshire TerrierPoodle
23German Longhaired PointerIrish SetterKorean JindoPortuguese Podengo Pequeno
24MastiffIcelandic SheepdogKarelian Bear DogPicardy Spaniel
25HavaneseIrish Water SpanielLeonbergerSiberian Husky
26Mountain FeistJack Russell TerrierMastiffSloughi
27Danish-Swedish FarmdogJagdterrierMountain FeistToy Fox Terrier
28Hamilton HoundKeeshondOld English Sheepdog
29Old English SheepdogKorean JindoPortuguese Podengo Pequeno
30Irish Water SpanielKarelian Bear DogPicardy Spaniel
31Irish SetterLeonbergerRhodesian Ridgeback
32PoodleLucas TerrierRottweiler
33Jack Russell TerrierMastiffVizsla
34Icelandic SheepdogMountain Feist
35Portuguese Podengo PequenoOld English Sheepdog
36JagdterrierPoodle
37Picardy SpanielPortuguese Podengo Pequeno
38KeeshondPicardy Spaniel
39Rhodesian RidgebackRhodesian Ridgeback
40RottweilerRottweiler
41Korean Jindo
42Whippet
43Yorkshire Terrier
44Siberian Husky
45Sloughi
46Toy Fox Terrier
47Vizsla
48 
Sheet1
Cell Formulas
RangeFormula
A2:A48A2=IFERROR(INDIRECT(TEXT(AGGREGATE(15,6,(ROW(B$1:F$40)*10^6+COLUMN(B$1:F$40))/((B$1:F$40<>"")*(ISNA(MATCH(B$1:F$40,A$1:A1,0)))),1),"R000000C000000"),0),"")
 
Upvote 1
So, doesn't this just boil down to simply "produce a list of the unique values that appear in the multi-column data"?
I guess...

If so, and you are looking for a formula solution (rather than vba or power query), that will work with Excel 2016, what about this?
I don't know what vba and power query is, but I'm not fussy about which method I use as long as I'm capable of using it :D

Regarding the formula you shared, I'm getting zeros everywhere except for the 2nd row, as you can see in the screenshots below.

Also, upon copy-pasting the formula into cell A1 and hitting ENTER I get this error message:

excel1 (1).jpg


Here's what it looks like with the formula inserted into several consecutive cells:

excel2 (1).jpg
 
Upvote 0
If you look more closely at my sample, the formula starts in cell A2, not A1. It needs to do that.
 
Upvote 0
oops, my bad :)

Yeah, the formula works on the sample file, but when I use it in the real file it returns numbers 1 to 5 for the first 5 rows, but then it works as intended. What could be the problem with those first 5 rows?
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,825
Members
449,190
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top