Hi all, first off a big thank-you to anyone who responds because I cant work this out!

I have a set of numbers in different cells. I want to sort the range based on the frequency of the number pattern in the row re-occuring.

So the below illustrates the challenge with an example, with the first table being the random numbers (the numbers 1,2,3,4,5 represent the rows and A1 – A5 the column header and not the data) and the second table shows the data set sorted based on frequency of occurence of the row of 4 cells. The rules requires that the 4 exact numbers repeat. 1,5,3,4 occurs 3 times, 2,5,1,3 occurs once and 4,5,5,5 occurs once.

Data before sort | ||||

A1 | A2 | A3 | A4 | |

1 | 1 | 5 | 3 | 4 |

2 | 2 | 5 | 1 | 3 |

3 | 4 | 5 | 5 | 5 |

4 | 1 | 5 | 3 | 4 |

5 | 1 | 5 | 3 | 4 |

Data after sort | ||||

A1 | A2 | A3 | A4 | |

1 | 1 | 5 | 3 | 4 |

2 | 1 | 5 | 3 | 4 |

3 | 1 | 5 | 3 | 4 |

4 | 2 | 5 | 1 | 3 |

5 | 4 | 5 | 5 | 5 |

By: Gareth