Spreadsheet: 889175d1739895906-sorting-a-list-of-numbers-with-extension-including-an-all-and-priority-scheme-sorting-question
Sheet: Sheet1

2011XXX00650  AA |  |  | Keep all "AA", "BB", "FF", "GG"
2011XXX02707  AA
2011XXX02707BB |  |  | If there is a 12 digit reference that contains at least one "CC" and/or "DD" and/or "EE" only show the first 12 digit reference including CC
2012XXX02785  AA |  |  | If there is a 12 digit reference that contains no "CC" at all but at least one "DD" and/or "EE" only show the first 12 digit reference including DD
2012XXX02785BB |  |  | If there are not 12 digit referenced that contain a CC or DD only then show the 12 digit refence including EE
2014XXX00341  AA02
2014XXX02704  EE
2014XXX02704  DD
2014XXX02704  DD01
2014XXX02704  CC
2014XXX03218  AA
2015XXX00192  CC
2015XXX00305  DD
2015XXX00317  EE
2015XXX00317  DD
2015XXX00317  CC
2015XXX00394  DD
2015XXX00394  CC
2015XXX00396  EE
2015XXX00396  DD
2015XXX00401  DD
2015XXX02712  EE
2015XXX02712  CC
2015XXX15694  EE
2015XXX15694  DD
2015XXX15694  CC
2016XXX01778  EE
2016XXX01778  CC
2016XXX01853  EE
2016XXX01853  DD
2016XXX01853  CC
2016XXX05113  AA
2016XXX33821  CC
2016XXX33821HHEE
2016XXX33821HHDD
2016XXX42178  EE
2016XXX42178  DD
2016XXX42178  CC
2017XXX41443  EE
2017XXX42021  EE
2017XXX42093  DD
2017XXX42146  DD
2018XXX00081  EE
2018XXX00081  DD
2018XXX00081  CC
2018XXX00657  EE
2018XXX00657  CC
2018XXX01641FF
2018XXX01641HHEE
2018XXX01641HHDD
2019XXX00273  AA01
2019XXX00316  EE
[NAME]
2019XXX00474  EE
2019XXX00554  EE
2019XXX00554  EE01
2019XXX00554  DD
2019XXX00554  CC
2019XXX00557  AA
2019XXX00793  EE
2019XXX00793  CC
2019XXX01005  AA
2019XXX01060  EE
2019XXX01060  DD
2019XXX01108  AA
2019XXX01233  EE
2019XXX01281  CC
2019XXX01448  AA03
2019XXX01600BB
2019XXX01710  EE
2019XXX01710  DD
2019XXX01710  CC
2019XXX02058  CC
2019XXX02077  DD
2019XXX02077  CC
2019XXX02286  DD
2019XXX02286  CC
2019XXX04007  EE
2019XXX04007  CC
2020XXX00533  DD
2020XXX00533  CC
2020XXX00599  EE
2020XXX00879  DD
2020XXX00879  CC
2020XXX01282  EE
2020XXX01282  DD
2020XXX01459  EE
2020XXX01459  CC
2020XXX01808  EE
2020XXX01808  CC
2020XXX01884  EE
2020XXX01884  CC
2020XXX01890  EE
2020XXX01890  CC
2020XXX01939  AA
2020XXX02022  EE
2020XXX02022  CC
2020XXX02555  EE
2020XXX02593  EE
2020XXX02593  CC
2020XXX04881  CC
2020XXX04881  AA
2020XXX04881FF
2021XXX01001  GG
2021XXX01007  CC
2021XXX01150  CC
2021XXX01151  AA
2021XXX01151BB
2021XXX01176BB
2021XXX01220  EE
2021XXX01220  CC
2021XXX01220BB
2021XXX01221  AA
2021XXX01221FF
2021XXX01224  CC
2021XXX01397  CC
2021XXX01397BB
2021XXX01494  AA
2021XXX01791  CC
2021XXX01791  AA
2021XXX01791FF
2021XXX01901  CC
2021XXX01968  AA
2021XXX02176  CC
2021XXX02293  CC
2021XXX02319  CC
2021XXX02319  AA
2021XXX02672  AA
2021XXX02672FF
2022XXX00239  AA
2022XXX00239  AA01
2022XXX00239BB  01
2022XXX00316  AA
2022XXX00396  AA
2022XXX01096  AA
2022XXX01253  AA
2022XXX01509  AA02
2022XXX01509BB
2022XXX01565  AA01
2022XXX01708  AA
2022XXX01728  AA
2022XXX01758  AA
2022XXX01801  AA
2022XXX02033  AA
2022XXX02071  AA
2022XXX02071HH
2022XXX02086  AA01
2022XXX02089  AA
2022XXX02214  GG
2022XXX02214  AA
2023XXX00260  AA
2023XXX00358  AA
2023XXX00358FF
2023XXX00398  AA
2023XXX00398BB
2023XXX00504  AA
2023XXX00707  AA
2023XXX00745  AA
2023XXX00752BB
2023XXX01165  AA
2023XXX01165FF
2023XXX01165HH
2023XXX02070  AA
2023XXX02214  AA
2023XXX02214BB