Formula to sort column alphabetically while removing duplicates

Lisa116

New Member
Joined
Jul 19, 2019
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi all,
In sheet1, I have a column with company names listed multiple times and I need to show the company names in sheet2 by alphabetical order in one row with each company listed in a separate column, up to 10 columns. I made the column that the names are in a table (table3) and used countif to get a unique count on sheet2 shown here: =INDEX(table3,MATCH(0,INDEX(COUNTIF($S$11:U11,table3),),0)). This works well until sheet1 is sorted, then the company names in the columns move around. The names need to be fixed on Sheet2 because there's other data below the company name in each column that correspond to each company.

Thanks,
LK
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have 365 with the sort function how about
+Fluff 1.xlsm
ABCDEFGHIJKL
1
2CumbriaCounty DurhamCumbriaDerbyshireDevonLancashireNorth YorkshireSouth YorkshireStaffordshireWest Yorkshire
3West Yorkshire
4Derbyshire
5West Yorkshire
6West Yorkshire
7Lancashire
8West Yorkshire
9County Durham
10Devon
11County Durham
12North Yorkshire
13West Yorkshire
14South Yorkshire
15Staffordshire
16North Yorkshire
17West Yorkshire
18
Main
Cell Formulas
RangeFormula
D2:L2D2=SORT(TRANSPOSE(UNIQUE(B2:B17)),,,1)
Dynamic array formulas.
 
Upvote 0
Fluff,
Thank you on both accounts. I have updated my account and the formula works like a charm. Thanks again!!
LK
 
Upvote 0
You're welcome & thanks for the feedback & updating your profile.
 
Upvote 0

Forum statistics

Threads
1,213,495
Messages
6,113,992
Members
448,538
Latest member
alex78

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