Formula to get unique values based on 3 columns?

Fractalis

Active Member
Joined
Oct 11, 2011
Messages
328
Office Version
  1. 365
Platform
  1. Windows
Hi all, I have the input table from A1:G28. My goal is get to get the unique rows based on 3 columns (A, C and G). The output would be like
the table in M1:O14.

I was able to get this table manually joining the 3 columns I need, then Data/Remove duplicates for values in column I. I got unique values
in K2:K14. Finally I splitted column I to get table in M1:O14.

How can this be done in a single Excel Formula? Thanks.

file.xlsx
ABCDEFGHIJKLMNO
1H1H2H3H4H5H6H7JoinedUnique JoinedH1H3H7
22XYUOHYR726PZ2-HY-Z2-HY-Z2HYZ
32XYUOHYR281PZ2-HY-Z2-HY-R2HYR
42XYUOHYR136PZ2-HY-Z2-HY-M2HYM
52XYUOHYR814PR2-HY-R3-HY-B3HYB
62XYUOHYR295PM2-HY-M3-BM-B3BMB
73PRO5UHYR547PB3-HY-B3-HY-H3HYH
83PRO5UHYR981PB3-HY-B2-HY-H2HYH
93PRO5UHYR274PB3-HY-B2-BM-W2BMW
103PRO5UBMR164PB3-BM-B2-BM-C2BMC
113PRO5UBMR130PB3-BM-B3-BM-G3BMG
123PRO5UBMR317PB3-BM-B3-BM-Z3BMZ
133PRO5UBMR702PB3-BM-B3-HY-Z3HYZ
143PRO5UHYR485PB3-HY-B3-BM-P3BMP
153PRO5UHYR780PB3-HY-B
163TTRWHYR628PH3-HY-H
172TTRWHYR693PH2-HY-H
182TTRWHYR980PH2-HY-H
192TTRWHYR498PH2-HY-H
202TTRWBMR870PW2-BM-W
212TTRWBMR846PC2-BM-C
222TTRWBMR720PC2-BM-C
233TTRWBMR989PG3-BM-G
243TTRWBMR353PZ3-BM-Z
253TTRWHYR703PZ3-HY-Z
263TTRWBMR605PZ3-BM-Z
273TTRWBMR496PP3-BM-P
283TTRWBMR914PZ3-BM-Z
Sheet1
Cell Formulas
RangeFormula
M2:O14M2=TEXTSPLIT(K2,"-")
I2:I28I2=A2&"-"&C2&"-"&G2
Dynamic array formulas.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
If you prefer to be more explicit with the column references you can use HSTACK. This makes the columns dynamic (robust if you insert or remove columns).
Excel Formula:
=UNIQUE(HSTACK(A2:A28,C2:C28,G2:G28))
 
Upvote 1
Put this into M2:

Excel Formula:
=UNIQUE(CHOOSECOLS(A2:G28,1,3,7))
If you prefer to be more explicit with the column references you can use HSTACK. This makes the columns dynamic (robust if you insert or remove columns).
Excel Formula:
=UNIQUE(HSTACK(A2:A28,C2:C28,G2:G28))
Thanks so much both for your solutions. Easier than I thought.
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,094
Members
453,021
Latest member
Justyna P

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