the total number of arrangements=(total with no restrictions)- ..........................[(total arrangements with all four letters adjacent)+ .............................(total arrangements with three of the letters adjacent)+ ...............................(total arrangements with two of the letters adjacent)+ .................................(total arrangements with one letter adjacent)]
total with no restrictions = 8!/(2!2!2!2!)=2520
total arrangements with all four letters adjacent=4!=24
total arrangements with three of the letters adjacent=[5!/2!-24] X 4C3=144
total arrangements with two of the letters adjacent=[6!/(2!2!)-(24+36+36)] X 4C2=504
total arrangements with one letter adjacent=[7!/(2!2!2!)-(24+36+36+36+84+84+84)] X 4C1=984
TF the total number of arrangements = 2520-(24+144+504+984) = 864
NOTE: all numbers in red are subtracted from the total as these were counted in the previous case(s)
all numbers in the [] are arrangements for one instance only and are multiplied by the numbers in blue to take into account all the different instances.