Converting a list of names & scores to a table

Alex91

New Member
Joined
Sep 11, 2014
Messages
2
Hello all,

I'm using Excel 2013. I have a list of names and scores, e.g.

Column A | Column B
Chris | 75%
Chris | 65%
Bob | 85%
Chris | 50%

I need to convert it into a table in the format below:

Chris | 75% | 65% | 50%
Bob | 85%

I've tried pivot tables and I can't seem to get them to do exactly what I want them to do - am I missing something? When more data is added to the columns, the table needs to update to accommodate for this. The list will consist of around a thousand entries. There is an unspecified number of scores for each name in the list.

Thank you in advance for any help you can offer, it's greatly appreciated. If I haven't been clear on anything, please let me know!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Code:
Sub convertTable()

    Application.ScreenUpdating = False


    Dim nextCol As Long
    Columns(3).Value = Columns(1).Value
    Columns(3).RemoveDuplicates Columns:=1, Header:=xlNo
    
    For x = 1 To Cells(Rows.Count, "C").End(xlUp).Row
        nextCol = 4
        For y = 1 To Cells(Rows.Count, "A").End(xlUp).Row
            If Cells(y, 1) = Cells(x, 3) Then
                Cells(x, nextCol) = Cells(y, 2)
                nextCol = nextCol + 1
            End If
        Next y
    Next x
    
    Columns(1).Delete
    Columns(1).Delete


    Application.ScreenUpdating = True
    
End Sub

For some reason it takes a second, probably the deleting of the tables. This assumes you ONLY have data in columns A and B.
 
Upvote 0
Thank you very much, I'll give that a try when I'm back in the office tomorrow!

Thanks again
 
Upvote 0

Forum statistics

Threads
1,213,486
Messages
6,113,932
Members
448,533
Latest member
thietbibeboiwasaco

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