In excel, how to calculate the number of inversions of two permutations of the same items (not necessarily numbers but may be say letters A B C D E). For example, I put the two permutaions in two columns, how to compute the number of inversions of the second column with respect to the first column?
I tried to searched online but most methods are about comparing two adjacent items on the same row of the two columns, which is not the mathematical definition of inversion of permutations.