For Example,
i have 4 columns first column cell have value = 2, second column cell having value = 3, third column cell having value = 5 and last column cell having value = 6.
i want the result to be like this
2 5
3 6
that means 2 and 3 are continuous so under 2 the value 3 has to come, since 4 is not available the value 5 should be in other column and its continuous 6 to be under 5.