I don't get the added stuff, but your original question to me... you can expand the function I gave you to as many columns of data as you wish. Just make sure all three parameters you feed into the function I provided have the same number of columns, in which case it will work the same for a 7 column table as 100 column table.