Turning a column with multiple entries for the same value into array

Thirith

Board Regular
Joined
Jun 9, 2009
Messages
120
Office Version
  1. 365
Platform
  1. Windows
I suspect that this will already have been answered elsewhere, but as I'm finding it difficult to put into words what I need to do, I'm finding it equally difficult to come up with good search terms.

Basically I've got this kind of situation: I have a spreadsheet with a list of scores given to items, but the number of scores for an item can differ, so the list might look something like this:
Item A4
Item A7
Item B8
Item B7
Item B9
Item C4
Item C 2
Item C5
Item D6

What would be the best/easiest way to turn this into the following?
Item A47
Item B879
Item C425
Item D6
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
assuming you have excel dynamics arrays this will do it

1729610098742.png


Formula in D2 =UNIQUE(A1:A9)
Formula in E2 =TRANSPOSE(FILTER(B1:B9,A1:A9=D1))

Short of that you would need Power Query
 

Attachments

  • 1729610069925.png
    1729610069925.png
    8.5 KB · Views: 0
Upvote 0
What version of Excel are you using?

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’)
 
Upvote 0
Excel Formula:
=LET(t,A1:A9,u,UNIQUE(t),IFERROR(HSTACK(u,DROP(REDUCE("",u,LAMBDA(a,b,VSTACK(a,TOROW(FILTER(B1:B9,t=b))))),1)),""))
 
Upvote 0
Here a shorter version

Excel Formula:
=LET(t,A1:A9,DROP(PIVOTBY(t,MAP(t,LAMBDA(x,SUM(--(A1:x=x)))),B1:B9,MAX,,0,,0),1))
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

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