Follow the concept of XOR LX, nowaday if you are using Excel 365, you can also use Let() formulaIf you want a formula-based solution, then enter this formula into a cell of your choice:
=MODE.MULT(IF(MMULT(0+ISNUMBER(FIND({1,2,3,4,5,6},ROW(INDEX($A:$A,123456):INDEX($A:$A,654321)))),{1;1;1;1;1;1})={6,6},ROW(INDEX($A:$A,123456):INDEX($A:$A,654321))))