bluelinecity.com

Where’s UNIQUE in spreadsheet programs?

November 5th, 2009

I’ve always been really bugged that Excel and OpenOffice Calc both don’t have an easy way to filter out unique values in columns. Sure I can do an auto-filter to see the unique values but that’s useless when I want to actually have a list of unique items.

So today I said enough is enough. I created a Runny command to take data from Excel / Calc ( that has been copied into the clipboard ) and filter out all the unique rows and place the results back into the clipboard. Here’s the command to create “unique” in runny.

new script unique if((t=Runny.getClipboard(0))){u={};r=[];t=t.split(/(\r\n)|\n|\r/g);for(c=0;c<t.length;c++)u[t[c]]=1;for(k in u)r.push(k);Runny.putClipboard(r.join('\r\n'));}

Now all I have to do is copy my excel data, run “unique” then paste the data back into excel where i need it.

Enjoy!

Leave a Reply