Your inner for-each seems a rather convoluted way of writing
<xsl:for-each select="qq:Cell[position() = (1,4,7,9,11)]">
That's 2.0 syntax: in 1.0 you have to write the predicate as
position() = 1 or position() = 4 or ...
You don't make it clear, but I suspect you want to sort the rows (the outer for-each) not the columns. So the outer for-each becomes
You need to be aware that there is no guarantee when you export an Excel spreadsheet as XML that the 9th Cell in a Row represents the contents of column 9 in the spreadsheet. Empty cells and cells spanning multiple columns can affect the count. But perhaps it works for your particular spreadsheet.
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference