I have a bunch of rows in a Google Spreadsheet that look as such:
a,b,c,d
a,d
c,d
b,d,f
a,b,f,g,h,i
q,b,b
…And on.
I need a way to create a unique list of related pairs in this format:
a,b
a,c
a,d
b,c
b,d
c,d
b,f
d,f
a,f
a,g
a,h
a,i
…And on.
Any idea how I’d do that? I’m open to answers using Google Spreadsheet’s scripting language, Excel 2004’s scripting language or something else like PHP.
Thanks!
Not sure if this satisfies your platform requirements, but here is a spreadsheet formula that can be used in Google Spreadsheets itself (not in any Excel version though):
It also assumes you don’t want to list “b,a” as well as “a,b”.
EDIT: These sort of formulae can be horribly inefficient for very large data sets, so consider only using if processing a few hundred rows or less.