If elegance and re usability is not important, I would suggest that you, for the sake of this example, imagine your starting sheet is called 'sheet foo':
- Use a delimited text to columns(they're separated by semicolon)
- Then you would need to use the =LEFT and =MID functions to trim the
brackets and semicolons.
- Then copy paste values.
- Right click 'sheet foo', go to copy\move, and create a copy, we'll
call this 'Sheet bar'
- Convert all of the data in 'Sheet bar' to a table (this step is not
absolutely necessary, but it will help me explain) and name the table
'Table bar'
- Return to 'Sheet foo'
- Then use the remove duplicates tool on each column
- Then copy and paste each column on to the end of the following column
until you've got one very long column. (so you would copy lets say
B2:B500, and paste it at C501, then copy C2:C1000 paste it on to
D501, etc. It's okay if they're not all equal number of rows, as
there may have been different occurrences of duplicate data)
- Re-apply the remove duplicates tool, and you should have a column
with all of the unique values for partners in 'Sheet foo'
- Copy, paste and transpose (ALT - E - S - E - Enter, in order, not at
once) on the same row as your headers
- You would now have every possible partner as a column header, in
'Sheet foo'
- Delete all of the columns in 'Sheet foo' that contain each company's
partners; this would leave your column structure so your headers are
| company | first partner | second partner | third partner | ... | final partner |
- then under each company header do a
=COUNTIF(FirstRowOfTableBar, CompanyHeader)
- and anchor 'FirstRowOfTableBar' on the X axis 'CompanyHeader' on the
Y axis. So it would look something like
=COUNTIF('Sheet bar'!$B2:$B10, 'Sheet foo'!B$2)
- Then copy and paste this formula for all company's rows, and all
partner's headers.
- Now you have a 0 where a company\partner relationship does NOT exist,
and a 1 where a company\partner relationship DOES exist.
Notes:
This could all go terribly wrong if the company column changes order somehow, in which case an even uglier solution involving either index\match, or offset, or perhaps array '=IF' formulas might be needed.