Formula to sort column alphabetically while removing duplicates

Lisa116

New Member
Joined
Jul 19, 2019
Messages
8
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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
60,321
Office Version
  1. 365
Platform
  1. Windows
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.
 

Lisa116

New Member
Joined
Jul 19, 2019
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Fluff,
Thank you on both accounts. I have updated my account and the formula works like a charm. Thanks again!!
LK
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
60,321
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback & updating your profile.
 

Forum statistics

Threads
1,137,124
Messages
5,679,743
Members
419,854
Latest member
marvin24

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
Top