Data reorganisation

Hi,

I've imported a 50000 lines CSV file with customer contact informations, but I would like to rearrange data.

My input table has this format :

customerIDcontacttypevalue
10001emailaaa@bbb.ccc
10001phone+123456789
10002emailccc@ddd.eee
10003emailddd@eee.com
10003phone+456789123
10004phone+789456123
10005emailrrr@ggg.ccc

Some customers has email and phone contact, but some has only email, or only phone contact. If the customer has email and phone contact, I have 2 lines with the same customer ID

And I would like to convert my table to have unique customer IDs, like this :

customerIDemailphone
10001aaa@bbb.ccc+123456789
10002ccc@ddd.eee
10003ddd@eee.com+456789123
10004+789456123
10005rrr@ggg.ccc

I've no idea how I can do this, I tried a lot of thing, with pivot tables, xlookup, but no success.

I don't even know if it's possible with simple formulas, or if I need to use VBA ?

If someone has any clue about how to do this, I would be very grateful :-)

Thanks a lot

Olivier

Hello,

You may use Power Query.

  1. Format your input table as Table (Ctrl+T when focus is on a cell from the table)
  2. Then, position the cursor on the Excel table, Select Data > Get & Transform Data > From Table/Range.
    Excel opens the Power Query Editor with your data displayed in a preview pane.
  3. In the Power Query editor, Select "ContactType" column, then Transform > Pivot Column.
    In the Pivot Column dialog box, in the Values Column list, select Value.
    Select Advanced options, and then select an Aggregate Value Function. In this case, select Don't aggregate
  4. OK

Load the data in the sheet.

That's all.

PS : If you add, or change data in your input table, go to the result table and hit Data > Refresh

Excactly what I needed, thank you very much !

Search for threads similar to "data reorganisation"